Commit eb325254 authored by JC Brand's avatar JC Brand

Split showChat into two methods to allow easier overriding.

parent 600650a4
...@@ -1398,10 +1398,7 @@ ...@@ -1398,10 +1398,7 @@
return this.model.chatBoxMayBeShown(chatbox); return this.model.chatBoxMayBeShown(chatbox);
}, },
showChat: function (attrs) { getChatBox: function (attrs) {
/* Find the chat box and show it (if it may be shown).
* If it doesn't exist, create it.
*/
var chatbox = this.model.get(attrs.jid); var chatbox = this.model.get(attrs.jid);
if (!chatbox) { if (!chatbox) {
chatbox = this.model.create(attrs, { chatbox = this.model.create(attrs, {
...@@ -1410,6 +1407,14 @@ ...@@ -1410,6 +1407,14 @@
} }
}); });
} }
return chatbox;
},
showChat: function (attrs) {
/* Find the chat box and show it (if it may be shown).
* If it doesn't exist, create it.
*/
var chatbox = this.getChatBox(attrs);
if (this.chatBoxMayBeShown(chatbox)) { if (this.chatBoxMayBeShown(chatbox)) {
chatbox.trigger('show', true); chatbox.trigger('show', true);
} }
......
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