diff --git a/irc/commands/commands.go b/irc/commands/commands.go index 2d31653..f0f9596 100644 --- a/irc/commands/commands.go +++ b/irc/commands/commands.go @@ -228,7 +228,7 @@ const ( RPL_NOUSERS = "395" // RFC1459 - Not Implemented (TODO:) ERR_UNKNOWNERROR = "400" // ??????? - Not Implemented (TODO:) - ERR_NOSUCHNICK = "401" // RFC1459 - Not Implemented (TODO:) + ERR_NOSUCHNICK = "401" // RFC1459 - Implemented ERR_NOSUCHSERVER = "402" // RFC1459 - Implemented ERR_NOSUCHCHANNEL = "403" // RFC1459 - Implemented ERR_CANNOTSENDTOCHAN = "404" // RFC1459 - Implemented diff --git a/irc/handler/handler.go b/irc/handler/handler.go index c2ece14..1b1882d 100644 --- a/irc/handler/handler.go +++ b/irc/handler/handler.go @@ -795,12 +795,23 @@ func handleWHOISMODES(msg irc.Message, client *irc.Client) { client.Channels[0].AppendMsg(msg.Timestamp, message, msgOpts) } -func handleNOSUCHSERVER(msg irc.Message, client *irc.Client) { - message := msg.Parameters[1] + " " + msg.Parameters[2] +func handleNOSUCHNICK(msg irc.Message, client *irc.Client) { + message := msg.Parameters[1] + ": " + msg.Parameters[2] msgOpts := irc.MsgFmtOpts{ WithTimestamp: true, - AsServerMsg: true, + AsErrorMsg: true, + } + + client.Channels[0].AppendMsg(msg.Timestamp, message, msgOpts) +} + +func handleNOSUCHSERVER(msg irc.Message, client *irc.Client) { + message := msg.Parameters[1] + ": " + msg.Parameters[2] + + msgOpts := irc.MsgFmtOpts{ + WithTimestamp: true, + AsErrorMsg: true, } client.Channels[0].AppendMsg(msg.Timestamp, message, msgOpts) @@ -1027,6 +1038,8 @@ func HandleCommand(msg irc.Message, client *irc.Client) { handleWHOISHOST(msg, client) case commands.RPL_WHOISMODES: handleWHOISMODES(msg, client) + case commands.ERR_NOSUCHNICK: + handleNOSUCHNICK(msg, client) case commands.ERR_NOSUCHSERVER: handleNOSUCHSERVER(msg, client) case commands.ERR_NOSUCHCHANNEL: