From 994fb7b42f3680a3309bf20cdda9a926d178f3cb Mon Sep 17 00:00:00 2001 From: prozacx Date: Sat, 16 Sep 2006 18:09:39 +0000 Subject: [PATCH] Patched using modified answer_pings_and_stuff.patch by psycho git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@763 726aef4b-f618-498e-8847-2d620e286838 --- IRCSock.cpp | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/IRCSock.cpp b/IRCSock.cpp index 17c937bf..856b7ac7 100644 --- a/IRCSock.cpp +++ b/IRCSock.cpp @@ -666,15 +666,21 @@ bool CIRCSock::OnPrivCTCP(CNick& Nick, CString& sMessage) { CString sQuery = sMessage.Token(0).AsUpper(); CString sReply; + if (it == mssCTCPReplies.end()) { + it = mssCTCPReplies.find(sQuery); + } + if (it != mssCTCPReplies.end()) { sReply = it->second; } - if (sReply.empty() && sQuery == "VERSION" && !m_pUser->IsUserAttached()) { - sReply = "ZNC by prozac - http://znc.sourceforge.net"; - } - - if (!sReply.empty()) { + if (sReply.empty() && !m_pUser->IsUserAttached()) { + if (sQuery == "VERSION") { + sReply = "ZNC by prozac - http://znc.sourceforge.net"; + } else if (sQuery == "PING") { + sReply = sMessage.Token(1, true); + } + } else if (!sReply.empty()) { PutIRC("NOTICE " + Nick.GetNick() + " :\001" + sQuery + " " + sReply + "\001"); return true; }