From 51a671c2687b8f67768efd1de82acd33e0579e2b Mon Sep 17 00:00:00 2001 From: citrons Date: Sat, 7 Jun 2025 23:56:22 -0500 Subject: keep stale information in whoMsg --- client/user_messages.go | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) (limited to 'client') diff --git a/client/user_messages.go b/client/user_messages.go index 5fccf82..21b9455 100644 --- a/client/user_messages.go +++ b/client/user_messages.go @@ -22,7 +22,10 @@ type userStatusMsg struct { type whoMsg struct { index int - user proto.Object + uid string + username string + status string + isGone bool } func (m nameChangeMsg) Id() string { @@ -79,15 +82,15 @@ func (m whoMsg) Show(odd bool) { tui.Pop() tui.Push("", tui.Box {Width: tui.Fill, Height: tui.TextSize}) - tui.Text(m.user.Fields[""], &tui.Style { + tui.Text(m.username, &tui.Style { Fg: tui.White, Bg: colorCmd[odd], Bold: true, }) tui.Text(" : ", nil) - if m.user.Fields["status"] != "" { - tui.Text(m.user.Fields["status"], nil) + if m.status != "" { + tui.Text(m.status, nil) } else { var text string - if m.user.Kind == "gone" { + if m.isGone { text = "gone" } else { text = "no status" @@ -124,6 +127,8 @@ func (w *cmdWindow) who(uid string) { return } lastIndex++ - w.Buf.Add(whoMsg {lastIndex, *u}) + w.Buf.Add(whoMsg { + lastIndex, uid, u.Fields[""], u.Fields["status"], u.Kind == "gone", + }) }) } -- cgit v1.2.3