about summary refs log tree commit diff
path: root/ui.c
diff options
context:
space:
mode:
authorKlemens Nanni <klemens@posteo.de>2021-07-17 20:04:15 +0000
committerJune McEnroe <june@causal.agency>2021-07-20 12:03:46 -0400
commitf8e3414af06df95b18b8e29caa74a7eea3022c92 (patch)
tree3924d2b8519cabb3d43c2114e243ba5b889ffa2b /ui.c
parentchat.tmux.conf: Fix base-index setting (diff)
downloadcatgirl-f8e3414af06df95b18b8e29caa74a7eea3022c92.tar.gz
catgirl-f8e3414af06df95b18b8e29caa74a7eea3022c92.zip
Add -q/quiet option to raise default message visibility threshold
Silencing all windows with `M-+' (across multiple catgirl instances)
can be cumbersome, so provide an option to hide events, JOIN/PART noise,
etc. by default (each window's threshold will persist across load/save
cycles, i.e. when using the `-s/save' option).

Started out as `-v | visibility = threshold' to set a specific level,
the idea of a simpler toggle comes from june, who also squashed other
bugs (as usual).
Diffstat (limited to 'ui.c')
-rw-r--r--ui.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/ui.c b/ui.c
index da06342..3604057 100644
--- a/ui.c
+++ b/ui.c
@@ -127,6 +127,8 @@ static struct Window *windowRemove(uint num) {
 	return window;
 }
 
+enum Heat uiThreshold = Cold;
+
 static uint windowFor(uint id) {
 	for (uint num = 0; num < windows.len; ++num) {
 		if (windows.ptrs[num]->id == id) return num;
@@ -136,7 +138,7 @@ static uint windowFor(uint id) {
 	window->id = id;
 	window->mark = true;
 	window->time = uiTime.enable;
-	window->thresh = Cold;
+	window->thresh = uiThreshold;
 	window->buffer = bufferAlloc();
 	completeAdd(None, idNames[id], idColors[id]);
 	return windowPush(window);