From e4a2fe26415eba5cf7920c08acd0313b1c75d1f4 Mon Sep 17 00:00:00 2001 From: delthas Date: Tue, 18 Oct 2022 17:27:20 +0200 Subject: Clear highlights from MARKREAD when only NotifyNone lines are left Previously, we did not clear buffers highlight statuses on MARKREAD if there was any unread line after it. This meant that if we received a plain message, than a join message, and some other device sent us a read marker for the plain message, we would still highlight the buffer. But we should not: a join message should not highlight the buffer. This is a recurrent use case because some clients do not display join mesasges and therefore do not send read markers for it. This updates the logic to actually store the notify level (in the line) and uses it to reset the highlight status when only NotifyNone messages (or no messages) are left. --- ui/ui.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'ui/ui.go') diff --git a/ui/ui.go b/ui/ui.go index 1a0da91..859f32a 100644 --- a/ui/ui.go +++ b/ui/ui.go @@ -270,8 +270,8 @@ func (ui *UI) RemoveNetworkBuffers(netID string) { ui.memberOffset = 0 } -func (ui *UI) AddLine(netID, buffer string, notify NotifyType, line Line) { - ui.bs.AddLine(netID, buffer, notify, line) +func (ui *UI) AddLine(netID, buffer string, line Line) { + ui.bs.AddLine(netID, buffer, line) } func (ui *UI) AddLines(netID, buffer string, before, after []Line) { -- cgit v1.2.3