Found more chatroom specific code in converse-core.js

This commit is contained in:
JC Brand 2016-02-28 19:22:54 +00:00
parent a4fd252a30
commit 9ae2f71747
2 changed files with 12 additions and 3 deletions

View File

@ -2284,9 +2284,7 @@
onChatBoxAdded: function (item) {
var view = this.get(item.get('id'));
if (!view) {
if (item.get('chatroom')) {
view = new converse.ChatRoomView({'model': item});
} else if (item.get('box_id') === 'controlbox') {
if (item.get('box_id') === 'controlbox') {
view = new converse.ControlBoxView({model: item});
} else {
view = new converse.ChatBoxView({model: item});

View File

@ -123,6 +123,17 @@
},
ChatBoxes: {
onChatBoxAdded: function (item) {
var view = this.get(item.get('id'));
if (!view && item.get('chatroom')) {
view = new converse.ChatRoomView({'model': item});
this.add(item.get('id'), view);
this.trimChats(view);
} else {
this._super.onChatBoxAdded.apply(this, arguments);
}
},
registerMessageHandler: function () {
/* Override so that we can register a handler
* for chat room invites.