about summary refs log tree commit diff stats
path: root/src/ui/window_list.c
diff options
context:
space:
mode:
authorMichael Vetter <jubalh@iodoru.org>2020-07-09 15:44:35 +0200
committerMichael Vetter <jubalh@iodoru.org>2020-07-09 15:44:35 +0200
commit11d849aa7ffb1d2f2dffac11d51f0f73728745a8 (patch)
tree31ee54891aa087b4e973d73ddc3ed99e29909bc5 /src/ui/window_list.c
parent8a2026ccbebeb9e482a85a9c8854e8005842ee54 (diff)
downloadprofani-tty-11d849aa7ffb1d2f2dffac11d51f0f73728745a8.tar.gz
Dont hilight console once all messages have been read
If we receive a message we get:
<< room message: eagle@conference.anoxinon.me (win 2)

Same for private chats and regular chats.
And several other kinds of notifications.

If we only receive notifications from a chat window it would be nice to
also clear the hilight on the console window since we already catched up
by reading the actual message in the chat window.

Probably not the best description :-) I hope you get it..

Regards https://github.com/profanity-im/profanity/issues/1399
Diffstat (limited to 'src/ui/window_list.c')
-rw-r--r--src/ui/window_list.c15
1 files changed, 15 insertions, 0 deletions
diff --git a/src/ui/window_list.c b/src/ui/window_list.c
index bb59e64d..c9ae8ba9 100644
--- a/src/ui/window_list.c
+++ b/src/ui/window_list.c
@@ -357,6 +357,21 @@ wins_set_current_by_num(int i)
             ProfPrivateWin* privatewin = (ProfPrivateWin*)window;
             privatewin->unread = 0;
         }
+
+        // if we switched to console
+        if (current == 0) {
+            // remove all alerts
+            cons_clear_alerts();
+        } else {
+            // remove alert from window where we switch to
+            cons_remove_alert(window);
+            // if there a no more alerts left
+            if (!cons_has_alerts()) {
+                // dont highlight console (no news there)
+                ProfWin* conswin = wins_get_console();
+                status_bar_active(1, conswin->type, "console");
+            }
+        }
     }
 }