Merge pull request #376 from medinae/reply-to-user-with-symbol-fix

Fix ~ Reply to user with symbol returning Err user not found
This commit is contained in:
Andrey Petrov 2021-03-13 10:08:49 -05:00 committed by GitHub
commit c8bfc34704
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -379,8 +379,7 @@ func (h *Host) InitCommands(c *chat.Commands) {
return errors.New("no message to reply to")
}
name := target.Name()
_, found := h.GetUser(name)
_, found := h.GetUser(target.ID())
if !found {
return errors.New("user not found")
}
@ -388,7 +387,7 @@ func (h *Host) InitCommands(c *chat.Commands) {
m := message.NewPrivateMsg(strings.Join(args, " "), msg.From(), target)
room.Send(&m)
txt := fmt.Sprintf("[Sent PM to %s]", name)
txt := fmt.Sprintf("[Sent PM to %s]", target.Name())
ms := message.NewSystemMsg(txt, msg.From())
room.Send(ms)
target.SetReplyTo(msg.From())