mirror of
https://github.com/znc/znc.git
synced 2026-05-08 22:34:45 +02:00
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:
@@ -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))
|
||||
|
||||
Reference in New Issue
Block a user