Commit 34ac7e99 authored by JC Brand's avatar JC Brand

Fixes #1024

Use sizzle, otherwise we sometimes get null returned.
parent 860befca
......@@ -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
......
......@@ -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 = $(
"<message from='"+from_jid+"' to='"+_converse.bare_jid+"'>" +
"<x xmlns='jabber:x:conference'" +
"jid='"+room_jid+"'" +
"reason='"+reason+"'/>"+
"</message>"
)[0];
expect(_converse.chatboxes.models.length).toBe(1);
expect(_converse.chatboxes.models[0].id).toBe("controlbox");
_converse.onDirectMUCInvitation(message);
var stanza = Strophe.xmlHtmlNode(
'<message xmlns="jabber:client" to="'+_converse.bare_jid+'" from="'+from_jid+'" id="9bceb415-f34b-4fa4-80d5-c0d076a24231">'+
'<x xmlns="jabber:x:conference" jid="'+room_jid+'" reason="'+reason+'"/>'+
'</message>').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+'"');
......
......@@ -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');
......
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