summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--client/user_messages.go17
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",
+ })
})
}