route_replies: Generic "not enough arguments" support

This teaches route_replies how to parse 461 numerics to find out which command
caused them. This way we don't have to add this numeric to all the requests we
route by hand.


git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@1598 726aef4b-f618-498e-8847-2d620e286838
This commit is contained in:
psychon
2009-08-17 17:56:26 +00:00
parent 11e360cb15
commit ca2beaffb6
+13 -4
View File
@@ -58,8 +58,6 @@ static const struct {
{"401", true},
// No such server
{"402", true},
// Not enough params
{"461", true},
{NULL, true}
}},
{"PING", {
@@ -82,8 +80,6 @@ static const struct {
}},
{"ISON", {
{"303", true},
// Not enough parameters
{"461", true},
{NULL, true}
}},
{"LINKS", {
@@ -200,6 +196,19 @@ public:
if (!m_pReplies)
return CONTINUE;
// Is this a "not enough arguments" error?
if (sCmd == "461") {
// :server 461 nick WHO :Not enough parameters
CString sOrigCmd = sLine.Token(3);
if (m_sLastRequest.Token(0).Equals(sOrigCmd)) {
// This is the reply to the last request
if (RouteReply(sLine, true))
return HALTCORE;
return CONTINUE;
}
}
while (m_pReplies[i].szReply != NULL) {
if (m_pReplies[i].szReply == sCmd) {
if (RouteReply(sLine, m_pReplies[i].bLastResponse))