Config count_joins_parts > count_all_activity; Do not show joins/parts by default
authorDarren <darren@darrenwhitlen.com>
Fri, 3 Jan 2014 09:04:31 +0000 (09:04 +0000)
committerDarren <darren@darrenwhitlen.com>
Fri, 3 Jan 2014 09:04:31 +0000 (09:04 +0000)
client/src/applets/settings.js
client/src/index.html.tmpl
client/src/translations/en-gb.po
client/src/views/channel.js
config.example.js

index bc16d376698347fb958cde596eb49233dc80b55d..c50dfd455346f91b2a61a00f45df2f81f6d0de6a 100644 (file)
@@ -13,7 +13,7 @@
                 list: _kiwi.global.i18n.translate('client_applets_settings_channelview_list').fetch(),\r
                 large_amounts_of_chans: _kiwi.global.i18n.translate('client_applets_settings_channelview_list_notice').fetch(),\r
                 join_part: _kiwi.global.i18n.translate('client_applets_settings_notification_joinpart').fetch(),\r
-                count_joins_parts: _kiwi.global.i18n.translate('client_applets_settings_notification_countjoinparts').fetch(),\r
+                count_all_activity: _kiwi.global.i18n.translate('client_applets_settings_notification_count_all_activity').fetch(),\r
                 timestamps: _kiwi.global.i18n.translate('client_applets_settings_timestamp').fetch(),\r
                 mute: _kiwi.global.i18n.translate('client_applets_settings_notification_sound').fetch(),\r
                 emoticons: _kiwi.global.i18n.translate('client_applets_settings_emoticons').fetch(),\r
index e1d1778a672a7525ac5675482af7a833a04dcbdd..f9454d9ee74788297ce3a4b70d70478191e598bd 100644 (file)
                     </div>\r
                     <div class="checkbox">\r
                         <label>\r
-                            <input data-setting="count_joins_parts" type="checkbox">\r
-                            <%= count_joins_parts %>\r
+                            <input data-setting="count_all_activity" type="checkbox">\r
+                            <%= count_all_activity %>\r
                         </label>\r
                     </div>\r
                     <div class="checkbox">\r
index c8c5ca25e30b4845ac049c156ba104c8aeec1612..e2318f8ab1932b922556f667f8f2b4d774294756 100755 (executable)
@@ -64,9 +64,9 @@ msgstr "for large amounts of channels"
 msgid "client_applets_settings_notification_joinpart"
 msgstr "Join/part channel notifications"
 
-#: 
-msgid "client_applets_settings_notification_countjoinparts"
-msgstr "Count join/part messages as notifications"
+#:
+msgid "client_applets_settings_notification_count_all_activity"
+msgstr "Include join/part messages as activity"
 
 #: 
 msgid "client_applets_settings_timestamp"
index c4d762bddb4b3cf99eb53a8cd644e7ed0e014950..e7860bcec2e47852ce90b5638c49f52904b093c8 100644 (file)
@@ -179,16 +179,27 @@ _kiwi.view.Channel = _kiwi.view.Panel.extend({
             // Only inrement the counters if we're not the active panel
             if (this.model.isActive()) return;
 
-            var $act = this.model.tab.find('.activity');
-            var count_joins_parts = _kiwi.global.settings.get('count_joins_parts');
-            if (typeof count_joins_parts === 'undefined') {
-                count_joins_parts = true;
+            var $act = this.model.tab.find('.activity'),
+                count_all_activity = _kiwi.global.settings.get('count_all_activity'),
+                exclude_message_types;
+
+            // Set the default config value
+            if (typeof count_all_activity === 'undefined') {
+                count_all_activity = false;
             }
 
-            if (count_joins_parts || msg.type === 'privmsg') {
+            // Do not increment the counter for these message types
+            exclude_message_types = [
+                'action join',
+                'action quit',
+                'action part',
+                'action kick',
+                'action nick',
+                'action mode'
+            ];
+
+            if (count_all_activity || exclude_message_types.indexOf(msg.type) === -1) {
                 $act.text((parseInt($act.text(), 10) || 0) + 1);
-            } else {
-                $act.text((parseInt($act.text(), 10) || 0));
             }
 
             if ($act.text() === '0') {
index c07855a632a8e450fb534c09aae70d23974345d6..77a2729a0e7e56d7322085bcd8b2e9af4e162531 100644 (file)
@@ -183,7 +183,7 @@ conf.client = {
         show_timestamps: false,
         mute_sounds: false,
         show_emoticons: true,
-        count_joins_parts: true
+        count_all_activity: true
     },
     window_title: 'Kiwi IRC'
 };