From ca2beaffb6b362bc7db6e9e5558cabb79e6d42f9 Mon Sep 17 00:00:00 2001 From: psychon Date: Mon, 17 Aug 2009 17:56:26 +0000 Subject: [PATCH] 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 --- modules/route_replies.cpp | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) diff --git a/modules/route_replies.cpp b/modules/route_replies.cpp index 88db2548..2bf6ec44 100644 --- a/modules/route_replies.cpp +++ b/modules/route_replies.cpp @@ -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))