mirror of
https://git.jabber.space/devs/cproof.git
synced 2026-07-25 22:06:22 +00:00
Fix room notification reminders
This commit is contained in:
@@ -277,6 +277,42 @@ prefs_do_room_notify(gboolean current_win, const char *const roomjid, const char
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
gboolean
|
||||
prefs_do_room_notify_mention(const char *const roomjid, int unread, gboolean mention, gboolean trigger)
|
||||
{
|
||||
gboolean notify_room = FALSE;
|
||||
if (g_key_file_has_key(prefs, roomjid, "notify", NULL)) {
|
||||
notify_room = g_key_file_get_boolean(prefs, roomjid, "notify", NULL);
|
||||
} else {
|
||||
notify_room = prefs_get_boolean(PREF_NOTIFY_ROOM);
|
||||
}
|
||||
if (notify_room && unread > 0) {
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
gboolean notify_mention = FALSE;
|
||||
if (g_key_file_has_key(prefs, roomjid, "notify.mention", NULL)) {
|
||||
notify_mention = g_key_file_get_boolean(prefs, roomjid, "notify.mention", NULL);
|
||||
} else {
|
||||
notify_mention = prefs_get_boolean(PREF_NOTIFY_ROOM_MENTION);
|
||||
}
|
||||
if (notify_mention && mention) {
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
gboolean notify_trigger = FALSE;
|
||||
if (g_key_file_has_key(prefs, roomjid, "notify.trigger", NULL)) {
|
||||
notify_trigger = g_key_file_get_boolean(prefs, roomjid, "notify.trigger", NULL);
|
||||
} else {
|
||||
notify_trigger = prefs_get_boolean(PREF_NOTIFY_ROOM_TRIGGER);
|
||||
}
|
||||
if (notify_trigger && trigger) {
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
void
|
||||
prefs_set_room_notify(const char *const roomjid, gboolean value)
|
||||
{
|
||||
|
||||
@@ -235,6 +235,7 @@ void prefs_set_string(preference_t pref, char *value);
|
||||
gboolean prefs_do_chat_notify(gboolean current_win);
|
||||
gboolean prefs_do_room_notify(gboolean current_win, const char *const roomjid, const char *const mynick,
|
||||
const char *const theirnick, const char *const message, gboolean mention, gboolean trigger_found);
|
||||
gboolean prefs_do_room_notify_mention(const char *const roomjid, int unread, gboolean mention, gboolean trigger);
|
||||
GList* prefs_message_get_triggers(const char *const message);
|
||||
|
||||
void prefs_set_room_notify(const char *const roomjid, gboolean value);
|
||||
|
||||
Reference in New Issue
Block a user