Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
C
converse.js
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
converse.js
Commits
5839e38f
Commit
5839e38f
authored
Feb 08, 2015
by
JC Brand
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Performance fix. updates #151
_.pluck was being called inside the form loop.
parent
235c3e15
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
10 additions
and
10 deletions
+10
-10
converse.js
converse.js
+10
-10
No files found.
converse.js
View file @
5839e38f
...
...
@@ -3530,20 +3530,20 @@
/* The localstorage cache containing roster contacts might contain
* some contacts that aren't actually in our roster anymore. We
* therefore need to remove them now.
*
* TODO: The method is a performance bottleneck.
* Basically we need to chuck out strophe.roster and
* rewrite it with backbone.js and well integrated into
* converse.js. Then we won't need to have this method at all.
*/
var
id
,
i
,
contact
;
for
(
i
=
0
;
i
<
this
.
models
.
length
;
++
i
)
{
id
=
this
.
models
[
i
].
get
(
'
id
'
);
if
(
_
.
indexOf
(
_
.
pluck
(
items
,
'
jid
'
),
id
)
===
-
1
)
{
contact
=
this
.
get
(
id
);
if
(
contact
&&
!
contact
.
get
(
'
requesting
'
))
{
contact
.
destroy
();
}
_
.
each
(
_
.
difference
(
this
.
pluck
(
'
jid
'
),
_
.
pluck
(
items
,
'
jid
'
)),
$
.
proxy
(
function
(
jid
)
{
var
contact
=
this
.
get
(
jid
);
if
(
contact
&&
!
contact
.
get
(
'
requesting
'
))
{
contact
.
destroy
();
}
}
}
,
this
));
},
// TODO: see if we can only use 2nd item par
rosterHandler
:
function
(
items
,
item
)
{
converse
.
emit
(
'
roster
'
,
items
);
this
.
clearCache
(
items
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment