Browse Source

Two changes, see below.

- Don't play a sound notification for forwarded messages.
- Bugfix. Return when no chat box returned.
JC Brand 10 years ago
parent
commit
1675109e71
1 changed files with 4 additions and 2 deletions
  1. 4 2
      converse.js

+ 4 - 2
converse.js

@@ -3527,11 +3527,13 @@
                 }
                 // Get chat box, but only create a new one when the message has a body.
                 chatbox = this.getChatBox(contact_jid, $message.find('body').length > 0);
-
+                if (!chatbox) {
+                    return true;
+                }
                 if (msgid && chatbox.messages.findWhere({msgid: msgid})) {
                     return true; // We already have this message stored.
                 }
-                if (!this.isOnlyChatStateNotification($message) && !is_me) {
+                if (!this.isOnlyChatStateNotification($message) && !is_me && !$forwarded.length) {
                     converse.playNotification();
                 }
                 chatbox.receiveMessage($message, $delay, archive_id);