Found more MUC code that should be in the view module
This commit is contained in:
parent
6f95628420
commit
cb0d8c7d86
@ -1815,6 +1815,21 @@
|
|||||||
fetchAndSetMUCDomain(view);
|
fetchAndSetMUCDomain(view);
|
||||||
view.model.on('change:connected', _.partial(fetchAndSetMUCDomain, view));
|
view.model.on('change:connected', _.partial(fetchAndSetMUCDomain, view));
|
||||||
});
|
});
|
||||||
|
|
||||||
|
function reconnectToChatRooms () {
|
||||||
|
/* Upon a reconnection event from converse, join again
|
||||||
|
* all the open chat rooms.
|
||||||
|
*/
|
||||||
|
_converse.chatboxviews.each(function (view) {
|
||||||
|
if (view.model.get('type') === converse.CHATROOMS_TYPE) {
|
||||||
|
view.model.save('connection_status', converse.ROOMSTATUS.DISCONNECTED);
|
||||||
|
view.model.registerHandlers();
|
||||||
|
view.join();
|
||||||
|
view.fetchMessages();
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
_converse.on('reconnected', reconnectToChatRooms);
|
||||||
/************************ END Event Handlers ************************/
|
/************************ END Event Handlers ************************/
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
@ -9,7 +9,6 @@
|
|||||||
"form-utils",
|
"form-utils",
|
||||||
"converse-core",
|
"converse-core",
|
||||||
"emojione",
|
"emojione",
|
||||||
"converse-chatview",
|
|
||||||
"converse-disco",
|
"converse-disco",
|
||||||
"backbone.overview",
|
"backbone.overview",
|
||||||
"backbone.orderedlistview",
|
"backbone.orderedlistview",
|
||||||
@ -68,7 +67,7 @@
|
|||||||
*
|
*
|
||||||
* NB: These plugins need to have already been loaded via require.js.
|
* NB: These plugins need to have already been loaded via require.js.
|
||||||
*/
|
*/
|
||||||
dependencies: ["converse-controlbox", "converse-chatview"],
|
dependencies: ["converse-controlbox"],
|
||||||
|
|
||||||
overrides: {
|
overrides: {
|
||||||
// Overrides mentioned here will be picked up by converse.js's
|
// Overrides mentioned here will be picked up by converse.js's
|
||||||
@ -1122,21 +1121,6 @@
|
|||||||
_converse.emit('roomsAutoJoined');
|
_converse.emit('roomsAutoJoined');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
function reconnectToChatRooms () {
|
|
||||||
/* Upon a reconnection event from converse, join again
|
|
||||||
* all the open chat rooms.
|
|
||||||
*/
|
|
||||||
_converse.chatboxviews.each(function (view) {
|
|
||||||
if (view.model.get('type') === converse.CHATROOMS_TYPE) {
|
|
||||||
view.model.save('connection_status', converse.ROOMSTATUS.DISCONNECTED);
|
|
||||||
view.model.registerHandlers();
|
|
||||||
view.join();
|
|
||||||
view.fetchMessages();
|
|
||||||
}
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
function disconnectChatRooms () {
|
function disconnectChatRooms () {
|
||||||
/* When disconnecting, or reconnecting, mark all chat rooms as
|
/* When disconnecting, or reconnecting, mark all chat rooms as
|
||||||
* disconnected, so that they will be properly entered again
|
* disconnected, so that they will be properly entered again
|
||||||
@ -1167,7 +1151,6 @@
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
_converse.on('chatBoxesFetched', autoJoinRooms);
|
_converse.on('chatBoxesFetched', autoJoinRooms);
|
||||||
_converse.on('reconnected', reconnectToChatRooms);
|
|
||||||
_converse.on('reconnecting', disconnectChatRooms);
|
_converse.on('reconnecting', disconnectChatRooms);
|
||||||
_converse.on('disconnecting', disconnectChatRooms);
|
_converse.on('disconnecting', disconnectChatRooms);
|
||||||
/************************ END Event Handlers ************************/
|
/************************ END Event Handlers ************************/
|
||||||
|
Loading…
Reference in New Issue
Block a user