Преглед на файлове

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

JC Brand преди 9 години
родител
ревизия
ee6d7ebd7a
променени са 1 файла, в които са добавени 3 реда и са изтрити 2 реда
  1. 3 2
      src/converse-notification.js

+ 3 - 2
src/converse-notification.js

@@ -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;
                 }