Fixes #735. Querying by attribute returns empty list

This commit is contained in:
JC Brand 2016-11-30 18:39:53 +01:00
parent 48791fa572
commit a3bc7a18e5
2 changed files with 9 additions and 1 deletions

View File

@ -1,5 +1,9 @@
# Changelog # Changelog
## 2.0.3 (2016-11-30)
- #735 Room configuration button not visible. [jcbrand]
- CSS fix for fadeIn animation. [jcbrand]
## 2.0.2 (2016-11-30) ## 2.0.2 (2016-11-30)
- #721 keepalive not working with anonymous authentication [jcbrand] - #721 keepalive not working with anonymous authentication [jcbrand]
- #723 Bugfix: Arrays in configuration settings were ignored. [jcbrand] - #723 Bugfix: Arrays in configuration settings were ignored. [jcbrand]

View File

@ -1138,8 +1138,12 @@
* See: http://xmpp.org/registrar/mucstatus.html * See: http://xmpp.org/registrar/mucstatus.html
*/ */
var from_nick = Strophe.unescapeNode(Strophe.getResourceFromJid(presence.getAttribute('from'))); var from_nick = Strophe.unescapeNode(Strophe.getResourceFromJid(presence.getAttribute('from')));
// XXX: Unfortunately presence.querySelectorAll('x[xmlns="'+Strophe.NS.MUC_USER+'"]') returns []
var elements = _.filter(presence.querySelectorAll('x'), function (x) {
return x.getAttribute('xmlns') === Strophe.NS.MUC_USER;
});
var notifications = _.map( var notifications = _.map(
presence.querySelectorAll('x[xmlns="'+Strophe.NS.MUC_USER+'"]'), elements,
_.partial(this.parseXUserElement.bind(this), _, is_self, from_nick) _.partial(this.parseXUserElement.bind(this), _, is_self, from_nick)
); );
_.each(notifications, this.displayNotificationsforUser.bind(this)); _.each(notifications, this.displayNotificationsforUser.bind(this));