From 65eb10a30ebbd3d4de6706b3a7fa713940aec7fa Mon Sep 17 00:00:00 2001 From: psychon Date: Mon, 12 Nov 2007 21:32:29 +0000 Subject: [PATCH] Make 'CTCPReply = VERSION' in the config cause ZNC to ignore CTCP VERSIONs git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@871 726aef4b-f618-498e-8847-2d620e286838 --- IRCSock.cpp | 4 +++- User.cpp | 2 +- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/IRCSock.cpp b/IRCSock.cpp index 9d461846..8a6970ba 100644 --- a/IRCSock.cpp +++ b/IRCSock.cpp @@ -776,6 +776,7 @@ bool CIRCSock::OnPrivCTCP(CNick& Nick, CString& sMessage) { const MCString& mssCTCPReplies = m_pUser->GetCTCPReplies(); MCString::const_iterator it = mssCTCPReplies.find(sMessage.AsUpper()); CString sQuery = sMessage.Token(0).AsUpper(); + bool bHaveReply = false; CString sReply; if (it == mssCTCPReplies.end()) { @@ -784,9 +785,10 @@ bool CIRCSock::OnPrivCTCP(CNick& Nick, CString& sMessage) { if (it != mssCTCPReplies.end()) { sReply = it->second; + bHaveReply = true; } - if (sReply.empty() && !m_pUser->IsUserAttached()) { + if (!bHaveReply && !m_pUser->IsUserAttached()) { if (sQuery == "VERSION") { sReply = CZNC::GetTag(); } else if (sQuery == "PING") { diff --git a/User.cpp b/User.cpp index 629096f0..2b743b94 100644 --- a/User.cpp +++ b/User.cpp @@ -1002,7 +1002,7 @@ void CUser::SetIRCNick(const CNick& n) { } bool CUser::AddCTCPReply(const CString& sCTCP, const CString& sReply) { - if (sCTCP.empty() || sReply.empty()) { + if (sCTCP.empty()) { return false; }