summaryrefslogtreecommitdiff
path: root/client/channel_window.go
diff options
context:
space:
mode:
authorcitrons <citrons@mondecitronne.com>2025-06-02 08:18:40 -0500
committercitrons <citrons@mondecitronne.com>2025-06-02 08:18:40 -0500
commitf14c0aa7a0ad19065d87424b3abc0fdabd9fe9bb (patch)
tree75a4e5058b412e73bce2e06bdc4f87bcb23acb14 /client/channel_window.go
parentc9548e938589d730338db84c9649fed81c852705 (diff)
indicate when a user is gone
Diffstat (limited to 'client/channel_window.go')
-rw-r--r--client/channel_window.go19
1 files changed, 14 insertions, 5 deletions
diff --git a/client/channel_window.go b/client/channel_window.go
index f9ed5a8..d003ce8 100644
--- a/client/channel_window.go
+++ b/client/channel_window.go
@@ -59,6 +59,12 @@ func (cw *channelWindow) username(uid string) string {
return "..."
}
+func (cw *channelWindow) isGone(uid string) bool {
+ cw.watchUser(uid)
+ u := globalApp.cache.Get(uid)
+ return u != nil && u.Kind == "gone"
+}
+
func (cw *channelWindow) put(msg proto.Object) {
cw.buf.Add(channelMsg {msg, cw})
}
@@ -273,17 +279,20 @@ func (m channelMsg) Show(odd bool) {
tui.Pop()
tui.Pop()
case "m":
- var usernameFg int32 = tui.White
+ nameStyle := tui.Style {Bg: bg, Fg: tui.White}
if m.Fields["f"] == globalApp.uid {
- usernameFg = tui.Cyan
+ nameStyle.Fg = tui.Cyan
+ }
+ if m.window.isGone(m.Fields["f"]) {
+ nameStyle.Italic = true
+ } else {
+ nameStyle.Bold = true
}
tui.Push("", tui.Box {Width: tui.Fill, Height: 1, Dir: tui.Left})
m.showDate(bg)
tui.Push("", tui.Box {Width: tui.TextSize, Height: 1, NoWrap: true})
- tui.Text(m.window.username(m.Fields["f"]), &tui.Style {
- Fg: usernameFg, Bg: bg, Bold: true,
- })
+ tui.Text(m.window.username(m.Fields["f"]), &nameStyle)
tui.Pop()
tui.Pop()