diff options
| author | citrons <citrons@mondecitronne.com> | 2025-06-07 23:56:22 -0500 |
|---|---|---|
| committer | citrons <citrons@mondecitronne.com> | 2025-06-07 23:56:22 -0500 |
| commit | 51a671c2687b8f67768efd1de82acd33e0579e2b (patch) | |
| tree | a04f108f8766dce472383b29cd2d6d95107f377f /client | |
| parent | 8a8f1f98859123e162090538cbdbe7f5c9d34ea4 (diff) | |
keep stale information in whoMsg
Diffstat (limited to 'client')
| -rw-r--r-- | client/user_messages.go | 17 |
1 files changed, 11 insertions, 6 deletions
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", + }) }) } |
