mirror of
https://github.com/znc/znc.git
synced 2026-08-06 08:52:57 +02:00
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:
+17
-1
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user