about summary refs log tree commit diff stats
path: root/src/ui/chatwin.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/ui/chatwin.c')
-rw-r--r--src/ui/chatwin.c28
1 files changed, 26 insertions, 2 deletions
diff --git a/src/ui/chatwin.c b/src/ui/chatwin.c
index c34cc1fc..2efe82e1 100644
--- a/src/ui/chatwin.c
+++ b/src/ui/chatwin.c
@@ -274,8 +274,32 @@ chatwin_incoming_msg(ProfChatWin *chatwin, const char *const resource, const cha
         beep();
     }
 
-    if (prefs_get_boolean(PREF_NOTIFY_MESSAGE)) {
-        notify_message(window, display_name, message);
+    if (!prefs_get_boolean(PREF_NOTIFY_MESSAGE)) {
+        free(display_name);
+        return;
+    }
+
+    gboolean notify = FALSE;
+
+    gboolean is_current = wins_is_current(window);
+    if (!is_current || (is_current && prefs_get_boolean(PREF_NOTIFY_MESSAGE_CURRENT)) ) {
+        notify = TRUE;
+    }
+
+    if (!notify) {
+        free(display_name);
+        return;
+    }
+
+    int ui_index = num;
+    if (ui_index == 10) {
+        ui_index = 0;
+    }
+
+    if (prefs_get_boolean(PREF_NOTIFY_MESSAGE_TEXT)) {
+        notify_message(display_name, ui_index, message);
+    } else {
+        notify_message(display_name, ui_index, NULL);
     }
 
     free(display_name);