From 7ba064d9d26d478ceaf9fa2bae903e0840f16d50 Mon Sep 17 00:00:00 2001 From: Darren Date: Fri, 3 Jan 2014 09:04:31 +0000 Subject: [PATCH] Config count_joins_parts > count_all_activity; Do not show joins/parts by default --- client/src/applets/settings.js | 2 +- client/src/index.html.tmpl | 4 ++-- client/src/translations/en-gb.po | 6 +++--- client/src/views/channel.js | 25 ++++++++++++++++++------- config.example.js | 2 +- 5 files changed, 25 insertions(+), 14 deletions(-) diff --git a/client/src/applets/settings.js b/client/src/applets/settings.js index bc16d37..c50dfd4 100644 --- a/client/src/applets/settings.js +++ b/client/src/applets/settings.js @@ -13,7 +13,7 @@ list: _kiwi.global.i18n.translate('client_applets_settings_channelview_list').fetch(), large_amounts_of_chans: _kiwi.global.i18n.translate('client_applets_settings_channelview_list_notice').fetch(), join_part: _kiwi.global.i18n.translate('client_applets_settings_notification_joinpart').fetch(), - count_joins_parts: _kiwi.global.i18n.translate('client_applets_settings_notification_countjoinparts').fetch(), + count_all_activity: _kiwi.global.i18n.translate('client_applets_settings_notification_count_all_activity').fetch(), timestamps: _kiwi.global.i18n.translate('client_applets_settings_timestamp').fetch(), mute: _kiwi.global.i18n.translate('client_applets_settings_notification_sound').fetch(), emoticons: _kiwi.global.i18n.translate('client_applets_settings_emoticons').fetch(), diff --git a/client/src/index.html.tmpl b/client/src/index.html.tmpl index e1d1778..f9454d9 100644 --- a/client/src/index.html.tmpl +++ b/client/src/index.html.tmpl @@ -228,8 +228,8 @@
diff --git a/client/src/translations/en-gb.po b/client/src/translations/en-gb.po index c8c5ca2..e2318f8 100755 --- a/client/src/translations/en-gb.po +++ b/client/src/translations/en-gb.po @@ -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" diff --git a/client/src/views/channel.js b/client/src/views/channel.js index c4d762b..e7860bc 100644 --- a/client/src/views/channel.js +++ b/client/src/views/channel.js @@ -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') { diff --git a/config.example.js b/config.example.js index c07855a..77a2729 100644 --- a/config.example.js +++ b/config.example.js @@ -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' }; -- 2.25.1