about summary refs log tree commit diff stats
path: root/src/ui/core.c
diff options
context:
space:
mode:
authorJames Booth <boothj5@gmail.com>2014-05-24 16:46:05 +0100
committerJames Booth <boothj5@gmail.com>2014-05-24 16:46:05 +0100
commit866d87af79b5fb02d49b60b9cc2298448f4b2fd4 (patch)
tree72aba2f139c3e2221bb6b2baa07808c3fa143ac8 /src/ui/core.c
parent7d90d218c0858ce278c8223fe72c455e3f950732 (diff)
downloadprofani-tty-866d87af79b5fb02d49b60b9cc2298448f4b2fd4.tar.gz
Added /notify room mention setting
Diffstat (limited to 'src/ui/core.c')
-rw-r--r--src/ui/core.c10
1 files changed, 9 insertions, 1 deletions
diff --git a/src/ui/core.c b/src/ui/core.c
index 09b12ea0..67fa618f 100644
--- a/src/ui/core.c
+++ b/src/ui/core.c
@@ -1696,7 +1696,15 @@ _ui_room_message(const char * const room_jid, const char * const nick,
         if (prefs_get_boolean(PREF_BEEP)) {
             beep();
         }
-        if (prefs_get_boolean(PREF_NOTIFY_ROOM)) {
+        char *room_setting = prefs_get_string(PREF_NOTIFY_ROOM);
+        gboolean notify = FALSE;
+        if (g_strcmp0(room_setting, "on") == 0) {
+            notify = TRUE;
+        }
+        if ( (g_strcmp0(room_setting, "mention") == 0) && (g_strrstr(message, nick) != NULL) ) {
+            notify = TRUE;
+        }
+        if (notify) {
             Jid *jidp = jid_create(room_jid);
             notify_room_message(nick, jidp->localpart, ui_index);
             jid_destroy(jidp);