瀏覽代碼

Don't show chat-state notifications by default.

JC Brand 8 年之前
父節點
當前提交
7b65155d5b
共有 3 個文件被更改,包括 12 次插入1 次删除
  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]
 - Improved roster filter UX. [jcbrand]
 - Render the login form again upon authfail. [jcbrand]
 - Render the login form again upon authfail. [jcbrand]
 - New promises API: [waitUntil](https://conversejs.org/docs/html/developer_api.html#waituntil) [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]
 - #770 Allow setting contact attrs on chats.open [Ape]
 
 
 ## 2.0.6 (2017-02-13)
 ## 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
     Converse.js can only show users and groups that were previously configured
     elsewhere.
     elsewhere.
 
 
+show_chatstate_notifications
+----------------------------
+
+* Default:  ``false``
+
+Specifies whether chat state (online, dnd, away) HTML5 desktop notifications should be shown.
+
 show_controlbox_by_default
 show_controlbox_by_default
 --------------------------
 --------------------------
 
 

+ 2 - 1
src/converse-notification.js

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