Browse Source

Use proper message handler. Fix typo

JC Brand 8 years ago
parent
commit
a4284e48f7
2 changed files with 6 additions and 6 deletions
  1. 5 5
      spec/chatroom.js
  2. 1 1
      src/converse-muc.js

+ 5 - 5
spec/chatroom.js

@@ -488,7 +488,7 @@
                         to: 'dummy@localhost',
                         type: 'groupchat'
                     }).c('body').t(message).tree();
-                _converse.chatboxes.onMessage(msg);
+                view.handleMUCMessage(msg);
                 expect(view.$el.find('.chat-message').hasClass('mentioned')).toBeTruthy();
             }));
 
@@ -505,7 +505,7 @@
                         to: 'dummy@localhost',
                         type: 'groupchat'
                     }).c('body').t(message).tree();
-                _converse.chatboxes.onMessage(msg);
+                view.handleMUCMessage(msg);
                 expect(_.includes(view.$el.find('.chat-msg-author').text(), '**Dyon van de Wege')).toBeTruthy();
                 expect(view.$el.find('.chat-msg-content').text()).toBe(' is tired');
 
@@ -516,7 +516,7 @@
                     to: 'dummy@localhost',
                     type: 'groupchat'
                 }).c('body').t(message).tree();
-                _converse.chatboxes.onMessage(msg);
+                view.handleMUCMessage(msg);
                 expect(_.includes(view.$el.find('.chat-msg-author:last').text(), '**Max Mustermann')).toBeTruthy();
                 expect(view.$el.find('.chat-msg-content:last').text()).toBe(' is as well');
             }));
@@ -1077,7 +1077,7 @@
                  * scrollbar.
                  */
                 for (var i=0; i<20; i++) {
-                    _converse.chatboxes.onMessage(
+                    view.handleMUCMessage(
                         $msg({
                             from: 'lounge@localhost/someone',
                             to: 'dummy@localhost.com',
@@ -1088,7 +1088,7 @@
                 // Give enough time for `markScrolled` to have been called
                 setTimeout(function () {
                     view.$content.scrollTop(0);
-                    _converse.chatboxes.onMessage(
+                    view.handleMUCMessage(
                         $msg({
                             from: 'lounge@localhost/someone',
                             to: 'dummy@localhost.com',

+ 1 - 1
src/converse-muc.js

@@ -544,7 +544,7 @@
                             .getExtraMessageClasses.apply(this, arguments);
 
                     if (this.is_chatroom && attrs.sender === 'them' &&
-                            this.model.isUserMentioned(attrs.mentioned)) {
+                            this.model.isUserMentioned(attrs.message)) {
                         // Add special class to mark groupchat messages
                         // in which we are mentioned.
                         extra_classes += ' mentioned';