Don't show notification reminders for messages the user does not want notifications for
This commit is contained in:
@@ -259,28 +259,29 @@ sv_ev_room_message(const char *const room_jid, const char *const nick, const cha
|
||||
mucwin_message(mucwin, nick, message, mention, triggers != NULL);
|
||||
|
||||
ProfWin *window = (ProfWin*)mucwin;
|
||||
gboolean is_current = wins_is_current(window);
|
||||
int num = wins_get_num(window);
|
||||
gboolean notify = prefs_do_room_notify(is_current, mucwin->roomjid, mynick, message, mention, triggers != NULL);
|
||||
gboolean is_current = FALSE;
|
||||
|
||||
// currently in groupchat window
|
||||
if (wins_is_current(window)) {
|
||||
is_current = TRUE;
|
||||
status_bar_active(num);
|
||||
|
||||
if ((g_strcmp0(mynick, nick) != 0) && (prefs_get_boolean(PREF_BEEP))) {
|
||||
beep();
|
||||
}
|
||||
|
||||
// not currently on groupchat window
|
||||
} else {
|
||||
status_bar_new(num);
|
||||
|
||||
cons_show_incoming_room_message(nick, mucwin->roomjid, num, mention, triggers, mucwin->unread);
|
||||
|
||||
if (prefs_get_boolean(PREF_FLASH) && (strcmp(nick, mynick) != 0)) {
|
||||
if ((g_strcmp0(mynick, nick) != 0) && (prefs_get_boolean(PREF_FLASH))) {
|
||||
flash();
|
||||
}
|
||||
|
||||
cons_show_incoming_room_message(nick, mucwin->roomjid, num, mention, triggers, mucwin->unread);
|
||||
|
||||
mucwin->unread++;
|
||||
if (notify) {
|
||||
mucwin->notify = TRUE;
|
||||
}
|
||||
|
||||
if (mention) {
|
||||
mucwin->unread_mentions = TRUE;
|
||||
@@ -290,26 +291,17 @@ sv_ev_room_message(const char *const room_jid, const char *const nick, const cha
|
||||
}
|
||||
}
|
||||
|
||||
if (prefs_do_room_notify(is_current, mucwin->roomjid, mynick, nick, message, mention, triggers != NULL)) {
|
||||
Jid *jidp = jid_create(mucwin->roomjid);
|
||||
notify_room_message(nick, jidp->localpart, num, message);
|
||||
jid_destroy(jidp);
|
||||
}
|
||||
|
||||
if (triggers) {
|
||||
g_list_free_full(triggers, free);
|
||||
}
|
||||
|
||||
rosterwin_roster();
|
||||
|
||||
// don't notify self messages
|
||||
if (strcmp(nick, mynick) == 0) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (prefs_get_boolean(PREF_BEEP)) {
|
||||
beep();
|
||||
}
|
||||
|
||||
if (notify) {
|
||||
Jid *jidp = jid_create(mucwin->roomjid);
|
||||
notify_room_message(nick, jidp->localpart, num, message);
|
||||
jid_destroy(jidp);
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
|
||||
Reference in New Issue
Block a user