소스 검색

Rename `update_title` setting to `show_tab_notifications`

JC Brand 4 년 전
부모
커밋
c002600ac5
4개의 변경된 파일20개의 추가작업 그리고 19개의 파일을 삭제
  1. 1 1
      CHANGES.md
  2. 8 7
      docs/source/configuration.rst
  3. 2 2
      spec/notification.js
  4. 9 9
      src/converse-notification.js

+ 1 - 1
CHANGES.md

@@ -3,7 +3,7 @@
 ## 8.0.0 (Unreleased)
 
 - #1083: Add support for XEP-0393 Message Styling
-- New configuration setting: [](https://conversejs.org/docs/html/configuration.html#trusted) instead.
+- New configuration setting: [show_tab_notifications](https://conversejs.org/docs/html/configuration.html#show-tab-notifications)
 
 ### Breaking Changes
 

+ 8 - 7
docs/source/configuration.rst

@@ -1833,6 +1833,14 @@ Adds a button to the chat which can be clicked or tapped in order to send the
 message.
 
 
+show_tab_notifications
+----------------------
+
+* Default: ``true``
+
+Determines whether an unread messages counter is shown in the tab.
+
+
 singleton
 ---------
 
@@ -1961,13 +1969,6 @@ Converse render the emojis with `Twemoji <https://twemoji.twitter.com/>`_.
 See also `emoji_image_path`_.
 
 
-update_title
-------------
-* Default: ``true``
-
-Determines whether to shows unread messages counter in the page title.
-
-
 visible_toolbar_buttons
 -----------------------
 

+ 2 - 2
spec/notification.js

@@ -228,7 +228,7 @@ describe("Notifications", function () {
 
         it("is incremented when the message is received and the window is not focused",
                 mock.initConverse(
-                    ['rosterGroupsFetched'], {'update_title': false},
+                    ['rosterGroupsFetched'], {'show_tab_notifications': false},
                     async function (done, _converse) {
 
             await mock.waitForRoster(_converse, 'current');
@@ -255,7 +255,7 @@ describe("Notifications", function () {
 
             expect(favico.badge.calls.count()).toBe(0);
 
-            _converse.api.settings.set('update_title', true);
+            _converse.api.settings.set('show_tab_notifications', true);
             const msg2 = $msg({
                     from: sender_jid,
                     to: _converse.connection.jid,

+ 9 - 9
src/converse-notification.js

@@ -17,7 +17,7 @@ converse.env.Favico = Favico;
 let favicon;
 
 function updateUnreadFavicon () {
-    if (api.settings.get('update_title')) {
+    if (api.settings.get('show_tab_notifications')) {
         favicon = favicon ?? new converse.env.Favico({type: 'circle', animation: 'pop'});
         const chats = _converse.chatboxes.models;
         const num_unread = chats.reduce((acc, chat) => (acc + (chat.get('num_unread') || 0)), 0);
@@ -36,17 +36,17 @@ converse.plugins.add('converse-notification', {
          */
 
         api.settings.extend({
-            update_title: true,
-            notify_all_room_messages: false,
-            show_desktop_notifications: true,
-            show_chat_state_notifications: false,
-            chatstate_notification_blacklist: [],
             // ^ a list of JIDs to ignore concerning chat state notifications
+            chatstate_notification_blacklist: [],
+            notification_delay: 5000,
+            notification_icon: 'logo/conversejs-filled.svg',
+            notify_all_room_messages: false,
+            notify_nicknames_without_references: false,
             play_sounds: true,
+            show_chat_state_notifications: false,
+            show_desktop_notifications: true,
+            show_tab_notifications: true,
             sounds_path: api.settings.get("assets_path")+'/sounds/',
-            notification_icon: 'logo/conversejs-filled.svg',
-            notification_delay: 5000,
-            notify_nicknames_without_references: false
         });
 
         /**