From fa2ff46ceec48056317a39a509cb5f455e9a058b Mon Sep 17 00:00:00 2001 From: JC Brand Date: Fri, 12 Sep 2014 19:31:53 +0200 Subject: [PATCH] Give chatroom's occupants view a ref to the chatroom view and thereby fix bug with directInvites. --- converse.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/converse.js b/converse.js index 528aa8458..ba49724fb 100644 --- a/converse.js +++ b/converse.js @@ -2133,7 +2133,7 @@ __("You may optionally include a message, explaining the reason for the invitation.") ); if (reason !== null) { - converse.connection.muc.rooms[this.model.get('id')].directInvite(suggestion.jid, reason); + converse.connection.muc.rooms[this.chatroomview.model.get('id')].directInvite(suggestion.jid, reason); converse.emit('roomInviteSent', this, suggestion.jid, reason); } $(ev.target).typeahead('val', ''); @@ -2180,8 +2180,9 @@ this); this.occupantsview = new converse.ChatRoomOccupantsView({ - model: new converse.ChatRoomOccupants({nick: this.model.get('nick')}) + model: new converse.ChatRoomOccupants({nick: this.model.get('nick')}), }); + this.occupantsview.chatroomview = this; this.render(); this.occupantsview.model.fetch({add:true}); this.connect(null);