mirror of
https://github.com/shazow/ssh-chat.git
synced 2025-06-07 10:53:07 +03:00
Fix ~ Reply to user with symbol returning Err user not found
This commit is contained in:
parent
d8183dd305
commit
ebbbc3b6d9
5
host.go
5
host.go
@ -379,8 +379,7 @@ func (h *Host) InitCommands(c *chat.Commands) {
|
|||||||
return errors.New("no message to reply to")
|
return errors.New("no message to reply to")
|
||||||
}
|
}
|
||||||
|
|
||||||
name := target.Name()
|
_, found := h.GetUser(target.ID())
|
||||||
_, found := h.GetUser(name)
|
|
||||||
if !found {
|
if !found {
|
||||||
return errors.New("user not 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)
|
m := message.NewPrivateMsg(strings.Join(args, " "), msg.From(), target)
|
||||||
room.Send(&m)
|
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())
|
ms := message.NewSystemMsg(txt, msg.From())
|
||||||
room.Send(ms)
|
room.Send(ms)
|
||||||
target.SetReplyTo(msg.From())
|
target.SetReplyTo(msg.From())
|
||||||
|
Loading…
x
Reference in New Issue
Block a user