diff --git a/CHANGES.md b/CHANGES.md index 4c6f18152..3460ca10c 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -3,11 +3,16 @@ ## 3.3.4 (Unreleased) - Avoid `eval` (via `_.template` from lodash). -- Bugfix. Avatars weren't being shown. -- Bugfix. Bookmarks list and open rooms list weren't recreated after logging in for a 2nd time (without reloading the browser). - Don't show bookmark toggles when PEP bookmarking not supported by the XMPP server. - Add LibreJS support +### Bugfixes + +- Avatars weren't being shown. +- Bookmarks list and open rooms list weren't recreated after logging in for a 2nd time (without reloading the browser). +- #1024 null reference on MUC Invite +- #1025 OTR lock icon disappears + ## 3.3.3 (2018-02-14) ### Bugfixes diff --git a/spec/chatroom.js b/spec/chatroom.js index 759ec8fbc..35be45f44 100644 --- a/spec/chatroom.js +++ b/spec/chatroom.js @@ -1423,16 +1423,15 @@ var from_jid = name.replace(/ /g,'.').toLowerCase() + '@localhost'; var room_jid = 'lounge@localhost'; var reason = "Please join this chat room"; - var message = $( - "" + - ""+ - "" - )[0]; + expect(_converse.chatboxes.models.length).toBe(1); expect(_converse.chatboxes.models[0].id).toBe("controlbox"); - _converse.onDirectMUCInvitation(message); + + var stanza = Strophe.xmlHtmlNode( + ''+ + ''+ + '').firstChild; + _converse.onDirectMUCInvitation(stanza); expect(window.confirm).toHaveBeenCalledWith( name + ' has invited you to join a chat room: '+ room_jid + ', and left the following reason: "'+reason+'"'); diff --git a/src/converse-muc.js b/src/converse-muc.js index be3eff9d8..4f5dbf20a 100644 --- a/src/converse-muc.js +++ b/src/converse-muc.js @@ -2839,7 +2839,7 @@ * (XMLElement) message: The message stanza containing the * invitation. */ - const x_el = message.querySelector('x[xmlns="jabber:x:conference"]'), + const x_el = sizzle('x[xmlns="jabber:x:conference"]', message).pop(), from = Strophe.getBareJidFromJid(message.getAttribute('from')), room_jid = x_el.getAttribute('jid'), reason = x_el.getAttribute('reason');