diff options
author | Berke Viktor <bviktor@hexchat.org> | 2012-10-13 12:38:01 +0200 |
---|---|---|
committer | Berke Viktor <bviktor@hexchat.org> | 2012-10-13 12:38:01 +0200 |
commit | b67b223c26ad4cc1784070b8d69e85623814e2d2 (patch) | |
tree | 5df4442ffefb94fed950b9d85b2220f89dc8317a /src/common | |
parent | 0ec02c13c7b17f2ad74a834f8b7b2d1ecc2d4630 (diff) |
Add option to omit alerts when marked as being away
Diffstat (limited to 'src/common')
-rw-r--r-- | src/common/cfgfiles.c | 1 | ||||
-rw-r--r-- | src/common/text.c | 12 | ||||
-rw-r--r-- | src/common/xchat.h | 1 |
3 files changed, 8 insertions, 6 deletions
diff --git a/src/common/cfgfiles.c b/src/common/cfgfiles.c index a787668e..d6a17a1e 100644 --- a/src/common/cfgfiles.c +++ b/src/common/cfgfiles.c @@ -392,6 +392,7 @@ default_file (void) const struct prefs vars[] = { {"away_auto_unmark", P_OFFINT (auto_unmark_away), TYPE_BOOL}, + {"away_omit_alerts", P_OFFINT (away_omit_alerts), TYPE_BOOL}, {"away_reason", P_OFFSET (awayreason), TYPE_STR}, {"away_show_message", P_OFFINT (show_away_message), TYPE_BOOL}, {"away_show_once", P_OFFINT (show_away_once), TYPE_BOOL}, diff --git a/src/common/text.c b/src/common/text.c index b558affd..20e4fd45 100644 --- a/src/common/text.c +++ b/src/common/text.c @@ -2203,9 +2203,9 @@ text_emit (int index, session *sess, char *a, char *b, char *c, char *d) case XP_TE_DPRIVMSG: case XP_TE_PRIVACTION: case XP_TE_DPRIVACTION: - if (chanopt_is_set_a (prefs.input_beep_priv, sess->alert_beep)) + if (chanopt_is_set_a (prefs.input_beep_priv, sess->alert_beep) && !prefs.away_omit_alerts) sound_beep (sess); - if (chanopt_is_set_a (prefs.input_flash_priv, sess->alert_taskbar)) + if (chanopt_is_set_a (prefs.input_flash_priv, sess->alert_taskbar) && !prefs.away_omit_alerts) fe_flash_window (sess); /* why is this one different? because of plugin-tray.c's hooks! ugly */ if (sess->alert_tray == SET_ON) @@ -2215,9 +2215,9 @@ text_emit (int index, session *sess, char *a, char *b, char *c, char *d) /* ===Highlighted message=== */ case XP_TE_HCHANACTION: case XP_TE_HCHANMSG: - if (chanopt_is_set_a (prefs.input_beep_hilight, sess->alert_beep)) + if (chanopt_is_set_a (prefs.input_beep_hilight, sess->alert_beep) && !prefs.away_omit_alerts) sound_beep (sess); - if (chanopt_is_set_a (prefs.input_flash_hilight, sess->alert_taskbar)) + if (chanopt_is_set_a (prefs.input_flash_hilight, sess->alert_taskbar) && !prefs.away_omit_alerts) fe_flash_window (sess); if (sess->alert_tray == SET_ON) fe_tray_set_icon (FE_ICON_MESSAGE); @@ -2226,9 +2226,9 @@ text_emit (int index, session *sess, char *a, char *b, char *c, char *d) /* ===Channel message=== */ case XP_TE_CHANACTION: case XP_TE_CHANMSG: - if (chanopt_is_set_a (prefs.input_beep_chans, sess->alert_beep)) + if (chanopt_is_set_a (prefs.input_beep_chans, sess->alert_beep) && !prefs.away_omit_alerts) sound_beep (sess); - if (chanopt_is_set_a (prefs.input_flash_chans, sess->alert_taskbar)) + if (chanopt_is_set_a (prefs.input_flash_chans, sess->alert_taskbar) && !prefs.away_omit_alerts) fe_flash_window (sess); if (sess->alert_tray == SET_ON) fe_tray_set_icon (FE_ICON_MESSAGE); diff --git a/src/common/xchat.h b/src/common/xchat.h index e9e4f157..6f82ed76 100644 --- a/src/common/xchat.h +++ b/src/common/xchat.h @@ -156,6 +156,7 @@ struct xchatprefs int away_timeout; int away_size_max; + int away_omit_alerts; int gui_pane_left_size; int gui_pane_right_size; |