diff --git a/client.go b/client.go index 632bf1f..f9f7956 100644 --- a/client.go +++ b/client.go @@ -117,3 +117,7 @@ func (client *Client) ReplyNotEnoughParameters(command string) { func (client *Client) ReplyNoChannel(channel string) { client.ReplyNicknamed("403", channel, "No such channel") } + +func (client *Client) ReplyNoNickChan(channel string) { + client.ReplyNicknamed("401", channel, "No such nick/channel") +} diff --git a/daemon.go b/daemon.go index 7263db7..5eb1a87 100644 --- a/daemon.go +++ b/daemon.go @@ -116,7 +116,7 @@ func (daemon *Daemon) SendWhois(client *Client, nicknames []string) { client.ReplyNicknamed("318", c.nickname, "End of WHOIS list") } if !found { - client.ReplyNicknamed("401", nickname, "No such nickname") + client.ReplyNoNickChan(nickname) } } } @@ -385,7 +385,7 @@ func (daemon *Daemon) Processor(events chan ClientEvent) { target, _ = RoomNameSanitize(target) r, found := daemon.rooms[target] if !found { - client.ReplyNicknamed("401", target, "No such nickname/channel") + client.ReplyNoNickChan(target) } daemon.room_sinks[r] <- ClientEvent{client, EVENT_MSG, command + " " + strings.TrimLeft(cols[1], ":")} case "TOPIC":