Commit fc251db5 authored by JC Brand's avatar JC Brand

Let MUC plugin override the chatbox wrapper.

parent 82107c0d
......@@ -184,8 +184,6 @@
'close': view.close.bind(view),
'focus': view.focus.bind(view),
'get': chatbox.get.bind(chatbox),
// FIXME: leaky abstraction from MUC
'is_chatroom': view.is_chatroom,
'maximize': chatbox.maximize.bind(chatbox),
'minimize': chatbox.minimize.bind(chatbox),
'open': view.show.bind(view),
......
......@@ -52,6 +52,17 @@
//
// New functions which don't exist yet can also be added.
wrappedChatBox: function (chatbox) {
/* Wrap a chatbox for outside consumption (i.e. so that it can be
* returned via the API.
*/
if (!chatbox) { return; }
var view = converse.chatboxviews.get(chatbox.get('jid'));
var box = this._super.wrappedChatBox.apply(this, arguments);
box.is_chatroom = view.is_chatroom;
return box;
},
Features: {
addClientFeatures: function () {
this._super.addClientFeatures.apply(this, arguments);
......
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