Commit 9ae2f717 authored by JC Brand's avatar JC Brand

Found more chatroom specific code in converse-core.js

parent a4fd252a
...@@ -2284,9 +2284,7 @@ ...@@ -2284,9 +2284,7 @@
onChatBoxAdded: function (item) { onChatBoxAdded: function (item) {
var view = this.get(item.get('id')); var view = this.get(item.get('id'));
if (!view) { if (!view) {
if (item.get('chatroom')) { if (item.get('box_id') === 'controlbox') {
view = new converse.ChatRoomView({'model': item});
} else if (item.get('box_id') === 'controlbox') {
view = new converse.ControlBoxView({model: item}); view = new converse.ControlBoxView({model: item});
} else { } else {
view = new converse.ChatBoxView({model: item}); view = new converse.ChatBoxView({model: item});
......
...@@ -123,6 +123,17 @@ ...@@ -123,6 +123,17 @@
}, },
ChatBoxes: { 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 () { registerMessageHandler: function () {
/* Override so that we can register a handler /* Override so that we can register a handler
* for chat room invites. * for chat room invites.
......
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