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; }