Closes #290 - opt-out for extra alerts now working

This commit is contained in:
misdre 2013-04-08 19:19:55 +02:00
parent ed27009285
commit 0424e5a329
3 changed files with 6 additions and 18 deletions

View File

@ -165,17 +165,6 @@ chanopt_is_set (unsigned int global, guint8 per_chan_setting)
return per_chan_setting; return per_chan_setting;
} }
/* additive version */
gboolean
chanopt_is_set_a (unsigned int global, guint8 per_chan_setting)
{
if (per_chan_setting == SET_DEFAULT)
return global;
return per_chan_setting || global;
}
/* === below is LOADING/SAVING stuff only === */ /* === below is LOADING/SAVING stuff only === */
typedef struct typedef struct

View File

@ -22,7 +22,6 @@
int chanopt_command (session *sess, char *tbuf, char *word[], char *word_eol[]); int chanopt_command (session *sess, char *tbuf, char *word[], char *word_eol[]);
gboolean chanopt_is_set (unsigned int global, guint8 per_chan_setting); gboolean chanopt_is_set (unsigned int global, guint8 per_chan_setting);
gboolean chanopt_is_set_a (unsigned int global, guint8 per_chan_setting);
void chanopt_save_all (void); void chanopt_save_all (void);
void chanopt_save (session *sess); void chanopt_save (session *sess);
void chanopt_load (session *sess); void chanopt_load (session *sess);

View File

@ -2080,9 +2080,9 @@ text_emit (int index, session *sess, char *a, char *b, char *c, char *d)
case XP_TE_DPRIVMSG: case XP_TE_DPRIVMSG:
case XP_TE_PRIVACTION: case XP_TE_PRIVACTION:
case XP_TE_DPRIVACTION: case XP_TE_DPRIVACTION:
if (chanopt_is_set_a (prefs.hex_input_beep_priv, sess->alert_beep) && (!prefs.hex_away_omit_alerts || !sess->server->is_away)) if (chanopt_is_set (prefs.hex_input_beep_priv, sess->alert_beep) && (!prefs.hex_away_omit_alerts || !sess->server->is_away))
sound_beep (sess); sound_beep (sess);
if (chanopt_is_set_a (prefs.hex_input_flash_priv, sess->alert_taskbar) && (!prefs.hex_away_omit_alerts || !sess->server->is_away)) if (chanopt_is_set (prefs.hex_input_flash_priv, sess->alert_taskbar) && (!prefs.hex_away_omit_alerts || !sess->server->is_away))
fe_flash_window (sess); fe_flash_window (sess);
/* why is this one different? because of plugin-tray.c's hooks! ugly */ /* why is this one different? because of plugin-tray.c's hooks! ugly */
if (sess->alert_tray == SET_ON) if (sess->alert_tray == SET_ON)
@ -2092,9 +2092,9 @@ text_emit (int index, session *sess, char *a, char *b, char *c, char *d)
/* ===Highlighted message=== */ /* ===Highlighted message=== */
case XP_TE_HCHANACTION: case XP_TE_HCHANACTION:
case XP_TE_HCHANMSG: case XP_TE_HCHANMSG:
if (chanopt_is_set_a (prefs.hex_input_beep_hilight, sess->alert_beep) && (!prefs.hex_away_omit_alerts || !sess->server->is_away)) if (chanopt_is_set (prefs.hex_input_beep_hilight, sess->alert_beep) && (!prefs.hex_away_omit_alerts || !sess->server->is_away))
sound_beep (sess); sound_beep (sess);
if (chanopt_is_set_a (prefs.hex_input_flash_hilight, sess->alert_taskbar) && (!prefs.hex_away_omit_alerts || !sess->server->is_away)) if (chanopt_is_set (prefs.hex_input_flash_hilight, sess->alert_taskbar) && (!prefs.hex_away_omit_alerts || !sess->server->is_away))
fe_flash_window (sess); fe_flash_window (sess);
if (sess->alert_tray == SET_ON) if (sess->alert_tray == SET_ON)
fe_tray_set_icon (FE_ICON_MESSAGE); fe_tray_set_icon (FE_ICON_MESSAGE);
@ -2103,9 +2103,9 @@ text_emit (int index, session *sess, char *a, char *b, char *c, char *d)
/* ===Channel message=== */ /* ===Channel message=== */
case XP_TE_CHANACTION: case XP_TE_CHANACTION:
case XP_TE_CHANMSG: case XP_TE_CHANMSG:
if (chanopt_is_set_a (prefs.hex_input_beep_chans, sess->alert_beep) && (!prefs.hex_away_omit_alerts || !sess->server->is_away)) if (chanopt_is_set (prefs.hex_input_beep_chans, sess->alert_beep) && (!prefs.hex_away_omit_alerts || !sess->server->is_away))
sound_beep (sess); sound_beep (sess);
if (chanopt_is_set_a (prefs.hex_input_flash_chans, sess->alert_taskbar) && (!prefs.hex_away_omit_alerts || !sess->server->is_away)) if (chanopt_is_set (prefs.hex_input_flash_chans, sess->alert_taskbar) && (!prefs.hex_away_omit_alerts || !sess->server->is_away))
fe_flash_window (sess); fe_flash_window (sess);
if (sess->alert_tray == SET_ON) if (sess->alert_tray == SET_ON)
fe_tray_set_icon (FE_ICON_MESSAGE); fe_tray_set_icon (FE_ICON_MESSAGE);