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-10 13:46:06 +0200
committerMichael Vetter <jubalh@iodoru.org>2020-07-10 13:46:06 +0200
commit10d771f3d1994cc450e96f25d45a3bbf297fb48f (patch)
treeab07025049b56f4e7acabde25764a49819bf899e /src/ui/window_list.c
parent63a71af8033c3297514e6721475b9bed797e8f97 (diff)
parentd075c62fed977644f4c32572bda31820002241e2 (diff)
downloadprofani-tty-10d771f3d1994cc450e96f25d45a3bbf297fb48f.tar.gz
Merge branch 'master' of github.com:profanity-im/profanity
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");
+            }
+        }
     }
 }