Let MUC plugin override the chatbox wrapper.
This commit is contained in:
parent
82107c0d96
commit
fc251db59e
@ -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);
|
||||
|
Loading…
Reference in New Issue
Block a user