Browse Source

Don't show chat-state notifications by default.

JC Brand 8 years ago
parent
commit
7b65155d5b
3 changed files with 12 additions and 1 deletions
  1. 3 0
      docs/CHANGES.md
  2. 7 0
      docs/source/configuration.rst
  3. 2 1
      src/converse-notification.js

+ 3 - 0
docs/CHANGES.md

@@ -10,6 +10,9 @@
 - Improved roster filter UX. [jcbrand]
 - Render the login form again upon authfail. [jcbrand]
 - New promises API: [waitUntil](https://conversejs.org/docs/html/developer_api.html#waituntil) [jcbrand]
+- New configuration setting:
+  [show_chatstate_notifications](https://conversejs.org/docs/html/configuration.html#show-chatstate-notifications)
+  [jcbrand]
 - #770 Allow setting contact attrs on chats.open [Ape]
 
 ## 2.0.6 (2017-02-13)

+ 7 - 0
docs/source/configuration.rst

@@ -885,6 +885,13 @@ configured.
     Converse.js can only show users and groups that were previously configured
     elsewhere.
 
+show_chatstate_notifications
+----------------------------
+
+* Default:  ``false``
+
+Specifies whether chat state (online, dnd, away) HTML5 desktop notifications should be shown.
+
 show_controlbox_by_default
 --------------------------
 

+ 2 - 1
src/converse-notification.js

@@ -32,6 +32,7 @@
             this.updateSettings({
                 notify_all_room_messages: false,
                 show_desktop_notifications: true,
+                show_chatstate_notifications: false,
                 chatstate_notification_blacklist: [],
                 // ^ a list of JIDs to ignore concerning chat state notifications
                 play_sounds: false,
@@ -211,7 +212,7 @@
                  * Will show an HTML5 notification to indicate that the chat
                  * status has changed.
                  */
-                if (_converse.areDesktopNotificationsEnabled()) {
+                if (_converse.areDesktopNotificationsEnabled() && _converse.show_chatstate_notifications) {
                     _converse.showChatStateNotification(contact);
                 }
             };