diff options
author | delthas <delthas@dille.cc> | 2022-10-18 17:27:20 +0200 |
---|---|---|
committer | delthas <delthas@dille.cc> | 2022-10-18 17:30:43 +0200 |
commit | e4a2fe26415eba5cf7920c08acd0313b1c75d1f4 (patch) | |
tree | 0fc1f5d28a1dcb177ae9681eb9222280ae0a534e /window.go | |
parent | Bump tcell version (diff) |
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.
Diffstat (limited to 'window.go')
-rw-r--r-- | window.go | 6 |
1 files changed, 3 insertions, 3 deletions
@@ -11,7 +11,7 @@ const welcomeMessage = "senpai dev build. Enter /help for a list of commands." func (app *App) initWindow() { app.win.AddBuffer("", "(home)", "") - app.win.AddLine("", "", ui.NotifyNone, ui.Line{ + app.win.AddLine("", "", ui.Line{ Head: "--", Body: ui.PlainString(welcomeMessage), At: time.Now(), @@ -39,9 +39,9 @@ func (app *App) queueStatusLine(netID string, line ui.Line) { func (app *App) addStatusLine(netID string, line ui.Line) { currentNetID, buffer := app.win.CurrentBuffer() if currentNetID == netID && buffer != "" { - app.win.AddLine(netID, buffer, ui.NotifyNone, line) + app.win.AddLine(netID, buffer, line) } - app.win.AddLine(netID, "", ui.NotifyNone, line) + app.win.AddLine(netID, "", line) } func (app *App) setStatus() { |