Get chat box views by id

Fixes bug when fetching controlbox, which doesn't have a jid
This commit is contained in:
JC Brand 2016-07-05 07:43:34 +02:00
parent 95d7c306d4
commit 5ed8dfbe0a
2 changed files with 2 additions and 2 deletions

View File

@ -187,7 +187,7 @@
* returned via the API.
*/
if (!chatbox) { return; }
var view = converse.chatboxviews.get(chatbox.get('jid'));
var view = converse.chatboxviews.get(chatbox.get('id'));
return {
'close': view.close.bind(view),
'focus': view.focus.bind(view),

View File

@ -65,7 +65,7 @@
* returned via the API.
*/
if (!chatbox) { return; }
var view = converse.chatboxviews.get(chatbox.get('jid'));
var view = converse.chatboxviews.get(chatbox.get('id'));
var box = this._super.wrappedChatBox.apply(this, arguments);
box.is_chatroom = view.is_chatroom;
return box;