Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
7
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Open sidebar
Cool Fire
hexchat
Commits
b67b223c
Commit
b67b223c
authored
Oct 13, 2012
by
Berke Viktor
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add option to omit alerts when marked as being away
parent
0ec02c13
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
21 additions
and
16 deletions
+21
-16
src/common/cfgfiles.c
src/common/cfgfiles.c
+1
-0
src/common/text.c
src/common/text.c
+6
-6
src/common/xchat.h
src/common/xchat.h
+1
-0
src/fe-gtk/fe-gtk.c
src/fe-gtk/fe-gtk.c
+1
-1
src/fe-gtk/plugin-tray.c
src/fe-gtk/plugin-tray.c
+9
-9
src/fe-gtk/setup.c
src/fe-gtk/setup.c
+3
-0
No files found.
src/common/cfgfiles.c
View file @
b67b223c
...
...
@@ -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
},
...
...
src/common/text.c
View file @
b67b223c
...
...
@@ -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
);
...
...
src/common/xchat.h
View file @
b67b223c
...
...
@@ -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
;
...
...
src/fe-gtk/fe-gtk.c
View file @
b67b223c
...
...
@@ -587,7 +587,7 @@ fe_set_hilight (struct session *sess)
if
(
sess
->
gui
->
is_tab
)
fe_set_tab_color
(
sess
,
3
);
/* set tab to blue */
if
(
prefs
.
input_flash_hilight
)
if
(
prefs
.
input_flash_hilight
&&
!
prefs
.
away_omit_alerts
)
fe_flash_window
(
sess
);
/* taskbar flash */
}
...
...
src/fe-gtk/plugin-tray.c
View file @
b67b223c
...
...
@@ -578,7 +578,7 @@ tray_hilight_cb (char *word[], void *userdata)
/*if (tray_status == TS_HIGHLIGHT)
return XCHAT_EAT_NONE;*/
if
(
prefs
.
input_tray_hilight
)
if
(
prefs
.
input_tray_hilight
&&
!
prefs
.
away_omit_alerts
)
{
tray_set_flash
(
ICON_HILIGHT
);
...
...
@@ -592,7 +592,7 @@ tray_hilight_cb (char *word[], void *userdata)
tray_hilight_count
,
word
[
1
],
xchat_get_info
(
ph
,
"channel"
));
}
if
(
prefs
.
input_balloon_hilight
)
if
(
prefs
.
input_balloon_hilight
&&
!
prefs
.
away_omit_alerts
)
tray_set_balloonf
(
word
[
2
],
_
(
DISPLAY_NAME
": Highlighted message from: %s (%s)"
),
word
[
1
],
xchat_get_info
(
ph
,
"channel"
));
...
...
@@ -605,7 +605,7 @@ tray_message_cb (char *word[], void *userdata)
if
(
/*tray_status == TS_MESSAGE ||*/
tray_status
==
TS_HIGHLIGHT
)
return
XCHAT_EAT_NONE
;
if
(
prefs
.
input_tray_chans
)
if
(
prefs
.
input_tray_chans
&&
!
prefs
.
away_omit_alerts
)
{
tray_set_flash
(
ICON_MSG
);
...
...
@@ -617,7 +617,7 @@ tray_message_cb (char *word[], void *userdata)
tray_set_tipf
(
_
(
DISPLAY_NAME
": %u new public messages."
),
tray_pub_count
);
}
if
(
prefs
.
input_balloon_chans
)
if
(
prefs
.
input_balloon_chans
&&
!
prefs
.
away_omit_alerts
)
tray_set_balloonf
(
word
[
2
],
_
(
DISPLAY_NAME
": New public message from: %s (%s)"
),
word
[
1
],
xchat_get_info
(
ph
,
"channel"
));
...
...
@@ -646,7 +646,7 @@ tray_priv (char *from, char *text)
tray_set_tipf
(
_
(
DISPLAY_NAME
": %u private messages, latest from: %s (%s)"
),
tray_priv_count
,
from
,
network
);
if
(
prefs
.
input_balloon_priv
)
if
(
prefs
.
input_balloon_priv
&&
!
prefs
.
away_omit_alerts
)
tray_set_balloonf
(
text
,
_
(
DISPLAY_NAME
": Private message from: %s (%s)"
),
from
,
network
);
}
...
...
@@ -657,7 +657,7 @@ tray_priv_cb (char *word[], void *userdata)
/*if (tray_status == TS_HIGHLIGHT)
return XCHAT_EAT_NONE;*/
if
(
prefs
.
input_tray_priv
)
if
(
prefs
.
input_tray_priv
&&
!
prefs
.
away_omit_alerts
)
tray_priv
(
word
[
1
],
word
[
2
]);
return
XCHAT_EAT_NONE
;
...
...
@@ -669,7 +669,7 @@ tray_invited_cb (char *word[], void *userdata)
/*if (tray_status == TS_HIGHLIGHT)
return XCHAT_EAT_NONE;*/
if
(
prefs
.
input_tray_priv
)
if
(
prefs
.
input_tray_priv
&&
!
prefs
.
away_omit_alerts
)
tray_priv
(
word
[
2
],
"Invited"
);
return
XCHAT_EAT_NONE
;
...
...
@@ -687,7 +687,7 @@ tray_dcc_cb (char *word[], void *userdata)
if
(
!
network
)
network
=
xchat_get_info
(
ph
,
"server"
);
if
(
prefs
.
input_tray_priv
)
if
(
prefs
.
input_tray_priv
&&
!
prefs
.
away_omit_alerts
)
{
tray_set_flash
(
ICON_FILE
);
...
...
@@ -700,7 +700,7 @@ tray_dcc_cb (char *word[], void *userdata)
tray_file_count
,
word
[
1
],
network
);
}
if
(
prefs
.
input_balloon_priv
)
if
(
prefs
.
input_balloon_priv
&&
!
prefs
.
away_omit_alerts
)
tray_set_balloonf
(
""
,
_
(
DISPLAY_NAME
": File offer from: %s (%s)"
),
word
[
1
],
network
);
...
...
src/fe-gtk/setup.c
View file @
b67b223c
...
...
@@ -361,6 +361,7 @@ static const setting alert_settings[] =
{
ST_3OGGLE
,
N_
(
"Make a beep sound on:"
),
0
,
0
,
(
void
*
)
beeplist
,
0
},
{
ST_TOGGLE
,
N_
(
"Enable system tray icon"
),
P_OFFINTNL
(
gui_tray
),
0
,
0
,
0
},
{
ST_TOGGLE
,
N_
(
"Omit alerts when marked as being away"
),
P_OFFINTNL
(
away_omit_alerts
),
0
,
0
,
0
},
{
ST_HEADER
,
N_
(
"Highlighted Messages"
),
0
,
0
,
0
},
{
ST_LABEL
,
N_
(
"Highlighted messages are ones where your nickname is mentioned, but also:"
),
0
,
0
,
0
,
1
},
...
...
@@ -381,6 +382,8 @@ static const setting alert_settings_hextray[] =
{
ST_3OGGLE
,
N_
(
"Blink task bar on:"
),
0
,
0
,
(
void
*
)
taskbarlist
,
0
},
{
ST_3OGGLE
,
N_
(
"Make a beep sound on:"
),
0
,
0
,
(
void
*
)
beeplist
,
0
},
{
ST_TOGGLE
,
N_
(
"Omit alerts when marked as being away"
),
P_OFFINTNL
(
away_omit_alerts
),
0
,
0
,
0
},
{
ST_HEADER
,
N_
(
"Highlighted Messages"
),
0
,
0
,
0
},
{
ST_LABEL
,
N_
(
"Highlighted messages are ones where your nickname is mentioned, but also:"
),
0
,
0
,
0
,
1
},
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment