Commit ee6d7ebd authored by JC Brand's avatar JC Brand

Bugfix. Need to strip the resource to get the room jid

parent e12c1654
......@@ -57,14 +57,15 @@
var notify_all = converse.notify_all_room_messages,
jid = $message.attr('from'),
resource = Strophe.getResourceFromJid(jid),
room_jid = Strophe.getBareJidFromJid(jid),
sender = resource && Strophe.unescapeNode(resource) || '';
if (sender === '' || $message.find('delay').length > 0) {
return false;
}
var room = converse.chatboxes.get(Strophe.getBareJidFromJid(jid));
var room = converse.chatboxes.get(room_jid);
var body = $message.children('body').text();
var mentioned = (new RegExp("\\b"+room.get('nick')+"\\b")).test(body);
notify_all = notify_all === true || (_.isArray(notify_all) && _.contains(notify_all, jid));
notify_all = notify_all === true || (_.isArray(notify_all) && _.contains(notify_all, room_jid));
if (sender === room.get('nick') || (!notify_all && !mentioned)) {
return false;
}
......
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