Commit 43ae702c authored by JC Brand's avatar JC Brand

Only fetch bookmarks once chatboxes can be handled.

parent 3edaffd3
...@@ -320,7 +320,7 @@ ...@@ -320,7 +320,7 @@
sent_stanza = iq; sent_stanza = iq;
IQ_id = sendIQ.bind(this)(iq, callback, errback); IQ_id = sendIQ.bind(this)(iq, callback, errback);
}); });
converse.emit('connected'); converse.emit('chatBoxesFetched');
/* Client requests all items /* Client requests all items
* ------------------------- * -------------------------
...@@ -395,7 +395,7 @@ ...@@ -395,7 +395,7 @@
spyOn(converse.connection, 'sendIQ').andCallFake(function (iq, callback, errback) { spyOn(converse.connection, 'sendIQ').andCallFake(function (iq, callback, errback) {
IQ_id = sendIQ.bind(this)(iq, callback, errback); IQ_id = sendIQ.bind(this)(iq, callback, errback);
}); });
converse.emit('connected'); converse.emit('chatBoxesFetched');
var stanza = $iq({'to': converse.connection.jid, 'type':'result', 'id':IQ_id}) var stanza = $iq({'to': converse.connection.jid, 'type':'result', 'id':IQ_id})
.c('pubsub', {'xmlns': Strophe.NS.PUBSUB}) .c('pubsub', {'xmlns': Strophe.NS.PUBSUB})
.c('items', {'node': 'storage:bookmarks'}) .c('items', {'node': 'storage:bookmarks'})
......
...@@ -365,8 +365,7 @@ ...@@ -365,8 +365,7 @@
); );
converse.bookmarks.fetchBookmarks(); converse.bookmarks.fetchBookmarks();
}; };
converse.on('connected', converse.initBookmarks); converse.on('chatBoxesFetched', converse.initBookmarks);
converse.on('reconnected', converse.initBookmarks);
} }
}); });
})); }));
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment