Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chat, main: Add /rename op command, optional symbol prefix #352

Merged
merged 4 commits into from
Aug 3, 2020
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
chat: Use user.ID() instead of user.Name()
  • Loading branch information
shazow committed Jun 24, 2020
commit cb0bdc8e0e99cceb65e329bb69b0bec5dc279b4a
4 changes: 2 additions & 2 deletions chat/message/user.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
}
Expand Down
2 changes: 1 addition & 1 deletion chat/room.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
}