about summary refs log tree commit diff stats
path: root/src/ui
diff options
context:
space:
mode:
Diffstat (limited to 'src/ui')
-rw-r--r--src/ui/console.c6
-rw-r--r--src/ui/core.c10
2 files changed, 11 insertions, 5 deletions
diff --git a/src/ui/console.c b/src/ui/console.c
index ea106ec8..16a12e35 100644
--- a/src/ui/console.c
+++ b/src/ui/console.c
@@ -1163,10 +1163,8 @@ _cons_notify_setting(void)
     else
         cons_show("Messages (/notify message)          : OFF");
 
-    if (prefs_get_boolean(PREF_NOTIFY_ROOM))
-        cons_show("Messages (/notify room)             : ON");
-    else
-        cons_show("Messages (/notify room)             : OFF");
+    char *room_setting = prefs_get_string(PREF_NOTIFY_ROOM);
+    cons_show    ("Chat room messages (/notify room)   : %s", room_setting);
 
     if (prefs_get_boolean(PREF_NOTIFY_TYPING))
         cons_show("Composing (/notify typing)          : ON");
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);