From 80082ba6f68530a3806705c6313abdc8cbb799d8 Mon Sep 17 00:00:00 2001 From: Sergey Matveev Date: Tue, 13 May 2014 23:56:29 +0400 Subject: [PATCH] Separate 401 code answer --- client.go | 4 ++++ daemon.go | 4 ++-- 2 files changed, 6 insertions(+), 2 deletions(-) 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":