notification: Implement notification option for channels

This commit is contained in:
BakasuraRCE
2020-07-29 09:50:12 -05:00
committed by Patrick
parent e03fab07ed
commit da26097aab
6 changed files with 67 additions and 9 deletions

View File

@@ -58,6 +58,7 @@ typedef struct
static const channel_options chanopt[] =
{
{"alert_balloon", NULL, S_F(alert_balloon)},
{"alert_beep", "BEEP", S_F(alert_beep)},
{"alert_taskbar", NULL, S_F(alert_taskbar)},
{"alert_tray", "TRAY", S_F(alert_tray)},
@@ -182,6 +183,7 @@ typedef struct
{
/* Per-Channel Alerts */
/* use a byte, because we need a pointer to each element */
guint8 alert_balloon;
guint8 alert_beep;
guint8 alert_taskbar;
guint8 alert_tray;

View File

@@ -493,6 +493,7 @@ session_new (server *serv, char *from, int type, int focus)
sess->logfd = -1;
sess->type = type;
sess->alert_balloon = SET_DEFAULT;
sess->alert_beep = SET_DEFAULT;
sess->alert_taskbar = SET_DEFAULT;
sess->alert_tray = SET_DEFAULT;

View File

@@ -363,6 +363,7 @@ typedef struct session
{
/* Per-Channel Alerts */
/* use a byte, because we need a pointer to each element */
guint8 alert_balloon;
guint8 alert_beep;
guint8 alert_taskbar;
guint8 alert_tray;

View File

@@ -138,7 +138,9 @@ enum
CHANNEL_FLAG_TRAY_UNSET = 1 << 18,
CHANNEL_FLAG_TASKBAR = 1 << 19,
CHANNEL_FLAG_TASKBAR_UNSET = 1 << 20,
CHANNEL_FLAG_COUNT = 21
CHANNEL_FLAG_BALLOON = 1 << 21,
CHANNEL_FLAG_BALLOON_UNSET = 1 << 22,
CHANNEL_FLAG_COUNT = 23
};
GSList *plugin_list = NULL; /* export for plugingui.c */
@@ -1633,6 +1635,8 @@ hexchat_list_int (hexchat_plugin *ph, hexchat_list *xlist, const char *name)
channel_flags[18] = ((struct session *)data)->alert_tray == SET_DEFAULT;
channel_flags[19] = ((struct session *)data)->alert_taskbar;
channel_flags[20] = ((struct session *)data)->alert_taskbar == SET_DEFAULT;
channel_flags[21] = ((struct session *)data)->alert_balloon;
channel_flags[22] = ((struct session *)data)->alert_balloon == SET_DEFAULT;
/* Set flags */
for (channel_flag = 0; channel_flag < CHANNEL_FLAG_COUNT; ++channel_flag) {