feat: handle ERR_NOSUCHNICK

This commit is contained in:
2025-08-15 22:17:13 +02:00
parent eab5f8747a
commit 1d10198d37
2 changed files with 17 additions and 4 deletions
+1 -1
View File
@@ -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
+16 -3
View File
@@ -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: