[PATCH] Update window status only on message at/above visiblity threshold

[PATCH] Update window status only on message at/above visiblity threshold

From: Klemens Nanni
If a window is set to highlight only, i.e. the status looks like
	2++ #highlight-or-nothing
the user is probably not interested in window status updates, e.g. new
unhighlighted messages, unless they reach the set visiblity threshold.

catgirl won't print unhighlighted messages in the window as expected,
but the status would still be updated on such uninteresting noise, i.e.
	2++ #highlight-or-nothing +34

Make window status update semantics match message visibility semantics.
Afterall, status changes result in UI redraws/disruptions/termnial bells
and whatnot.
---
 ui.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/ui.c b/ui.c
index 03d77bb..8d691a4 100644
--- a/ui.c
+++ b/ui.c
@@ -407,6 +407,7 @@ static void statusUpdate(void) {
 	for (uint num = 0; num < windows.len; ++num) {
 		const struct Window *window = windows.ptrs[num];
 		if (num != windows.show && !window->scroll) {
+			if (window->heat < window->thresh) continue;
 			if (window->heat < Warm) continue;
 			if (window->mute && window->heat < Hot) continue;
 		}
@@ -437,6 +438,7 @@ static void statusUpdate(void) {
 	wclrtoeol(status);
 
 	const struct Window *window = windows.ptrs[windows.show];
+	if (window->heat < window->thresh) return;
 	char *end = &title[sizeof(title)];
 	char *ptr = seprintf(
 		title, end, "%s %s", network.name, idNames[window->id]
-- 
2.32.0

Re: [PATCH] Update window status only on message at/above visiblity threshold

From: june
> On Jul 28, 2021, at 13:19, Klemens Nanni <klemens@posteo.de> wrote:
> 
> If a window is set to highlight only, i.e. the status looks like
> 	2++ #highlight-or-nothing
> the user is probably not interested in window status updates, e.g. new
> unhighlighted messages, unless they reach the set visiblity threshold.
> 
> catgirl won't print unhighlighted messages in the window as expected,
> but the status would still be updated on such uninteresting noise, i.e.
> 	2++ #highlight-or-nothing +34
> 
> Make window status update semantics match message visibility semantics.
> Afterall, status changes result in UI redraws/disruptions/termnial bells
> and whatnot.

I don’t think I agree with this. On the opposite end, if the status
shows 2- and ignored messages are visible, that shouldn’t mean that
joins and parts are reported as unread. Visibility and status
semantics are separate, the M-= key to toggle mute already does the
above.

Re: [PATCH] Update window status only on message at/above visiblity threshold

From: Klemens Nanni
To: june
On Thu, Jul 29, 2021 at 10:29:18AM -0400, june wrote:
> I don’t think I agree with this. On the opposite end, if the status
> shows 2- and ignored messages are visible, that shouldn’t mean that
> joins and parts are reported as unread. Visibility and status
> semantics are separate, the M-= key to toggle mute already does the
> above.

I guess you're right, this basically reimplements mute which I didn't
use so far, hence didn't account for in the diff.

I'll get `M-=' into my muscle memory and drop this diff, thanks.