|
@@ -180,6 +180,9 @@
|
|
|
|
|
|
initialize: function () {
|
|
|
this.model.messages.on('add', this.onMessageAdded, this);
|
|
|
+ this.model.on('show', this.show, this);
|
|
|
+ this.model.on('destroy', this.hide, this);
|
|
|
+
|
|
|
this.occupantsview = new converse.ChatRoomOccupantsView({
|
|
|
model: new converse.ChatRoomOccupants({nick: this.model.get('nick')})
|
|
|
});
|
|
@@ -191,7 +194,6 @@
|
|
|
this.join(null, {'maxstanzas': converse.muc_history_max_stanzas});
|
|
|
this.fetchMessages();
|
|
|
this.$el.insertAfter(converse.chatboxviews.get("controlbox").$el);
|
|
|
- this.show();
|
|
|
converse.emit('chatRoomOpened', this);
|
|
|
},
|
|
|
|
|
@@ -1312,12 +1314,8 @@
|
|
|
}
|
|
|
}
|
|
|
};
|
|
|
- var onConnected = function () {
|
|
|
- converse.connection.addHandler(
|
|
|
- function (message) {
|
|
|
- converse.onDirectMUCInvitation(message);
|
|
|
- return true;
|
|
|
- }, 'jabber:x:conference', 'message');
|
|
|
+
|
|
|
+ var autoJoinRooms = function () {
|
|
|
_.each(converse.auto_join_rooms, function (room) {
|
|
|
if (typeof room === 'string') {
|
|
|
converse_api.rooms.open(room);
|
|
@@ -1328,6 +1326,15 @@
|
|
|
}
|
|
|
});
|
|
|
};
|
|
|
+ converse.on('chatBoxesFetched', autoJoinRooms);
|
|
|
+
|
|
|
+ var onConnected = function () {
|
|
|
+ converse.connection.addHandler(
|
|
|
+ function (message) {
|
|
|
+ converse.onDirectMUCInvitation(message);
|
|
|
+ return true;
|
|
|
+ }, 'jabber:x:conference', 'message');
|
|
|
+ };
|
|
|
converse.on('connected', onConnected);
|
|
|
converse.on('reconnected', onConnected);
|
|
|
/* ------------------------------------------------------------ */
|