Handle CTCP to *status

We only answer to PING and VERSION.


git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@890 726aef4b-f618-498e-8847-2d620e286838
This commit is contained in:
psychon
2007-12-02 09:25:19 +00:00
parent 496e164bef
commit f74f501d5a
2 changed files with 18 additions and 1 deletions
+17 -1
View File
@@ -436,10 +436,16 @@ void CClient::ReadLine(const CString& sData) {
}
if (strncasecmp(sTarget.c_str(), m_pUser->GetStatusPrefix().c_str(), m_pUser->GetStatusPrefix().length()) == 0) {
#ifdef _MODULES
CString sModule = sTarget;
sModule.LeftChomp(m_pUser->GetStatusPrefix().length());
if (sModule == "status") {
StatusCTCP(sCTCP);
return;
}
#ifdef _MODULES
CModule* pModule = m_pUser->GetModules().FindModule(sModule);
if (pModule) {
pModule->SetClient(this);
@@ -571,6 +577,16 @@ bool CClient::DecKeepNickCounter() {
return true;
}
void CClient::StatusCTCP(const CString& sLine) {
CString sCommand = sLine.Token(0);
if (sCommand.CaseCmp("PING") == 0) {
PutStatusNotice("\001PING " + sLine.Token(1, true) + "\001");
} else if (sCommand.CaseCmp("VERSION") == 0) {
PutStatusNotice("\001VERSION " + CZNC::GetTag() + "\001");
}
}
void CClient::UserCommand(const CString& sLine) {
if (!m_pUser) {
return;