bookmarks: Don't autojoin rooms prematurely
by first waiting until chatboxes have been fetched as well.
This commit is contained in:
parent
d81d62f98d
commit
3835ab7af6
|
@ -189,6 +189,7 @@ Converse.js has the following promises:
|
|||
* rosterGroupsFetched
|
||||
* rosterInitialized
|
||||
* statusInitialized
|
||||
* roomsPanelRendered (only via the `converse-muc` plugin)
|
||||
|
||||
Below is an example from `converse-muc.js <https://github.com/jcbrand/converse.js/blob/master/src/converse-muc.js>`_
|
||||
where the `rosterContactsFetched` promise is waited on. The method
|
||||
|
|
|
@ -470,7 +470,8 @@
|
|||
});
|
||||
_converse.emit('bookmarksInitialized');
|
||||
};
|
||||
_converse.on('roomsPanelRendered', initBookmarks);
|
||||
$.when(_converse.api.waitUntil('chatBoxesFetched'),
|
||||
_converse.api.waitUntil('roomsPanelRendered')).then(initBookmarks);
|
||||
|
||||
var afterReconnection = function () {
|
||||
if (!_converse.allow_bookmarks) {
|
||||
|
|
|
@ -319,6 +319,10 @@
|
|||
},
|
||||
});
|
||||
|
||||
_.extend(_converse.promises, {
|
||||
'roomsPanelRendered': new $.Deferred()
|
||||
});
|
||||
|
||||
_converse.createChatRoom = function (settings) {
|
||||
/* Creates a new chat room, making sure that certain attributes
|
||||
* are correct, for example that the "type" is set to
|
||||
|
@ -385,7 +389,7 @@
|
|||
});
|
||||
} else {
|
||||
this.fetchMessages();
|
||||
_converse.emit('chatRoomOpened', that);
|
||||
_converse.emit('chatRoomOpened', this);
|
||||
}
|
||||
},
|
||||
|
||||
|
|
Loading…
Reference in New Issue
Block a user