chat: Use user.ID() instead of user.Name()
This commit is contained in:
parent
36843252b4
commit
cb0bdc8e0e
|
@ -206,7 +206,7 @@ func (u *User) writeMsg(m Message) error {
|
|||
r := u.render(m)
|
||||
_, err := u.screen.Write([]byte(r))
|
||||
if err != nil {
|
||||
logger.Printf("Write failed to %s, closing: %s", u.Name(), err)
|
||||
logger.Printf("Write failed to %s, closing: %s", u.ID(), err)
|
||||
u.Close()
|
||||
}
|
||||
return err
|
||||
|
@ -227,7 +227,7 @@ func (u *User) Send(m Message) error {
|
|||
return ErrUserClosed
|
||||
case u.msg <- m:
|
||||
case <-time.After(messageTimeout):
|
||||
logger.Printf("Message buffer full, closing: %s", u.Name())
|
||||
logger.Printf("Message buffer full, closing: %s", u.ID())
|
||||
u.Close()
|
||||
return ErrUserClosed
|
||||
}
|
||||
|
|
|
@ -239,7 +239,7 @@ func (r *Room) NamesPrefix(prefix string) []string {
|
|||
// Pull out names
|
||||
names := make([]string, 0, len(items))
|
||||
for _, user := range users {
|
||||
names = append(names, user.Name())
|
||||
names = append(names, user.ID())
|
||||
}
|
||||
return names
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue