mirror of
https://github.com/znc/znc.git
synced 2026-03-28 17:42:41 +01:00
Enhanced the /znc command to optionally accept commands.
git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@1228 726aef4b-f618-498e-8847-2d620e286838
This commit is contained in:
24
Client.cpp
24
Client.cpp
@@ -145,7 +145,29 @@ void CClient::ReadLine(const CString& sData) {
|
||||
}
|
||||
|
||||
if (sCommand.CaseCmp("ZNC") == 0) {
|
||||
PutStatus("Hello. How may I help you?");
|
||||
CString sTarget = sLine.Token(1);
|
||||
CString sModCommand;
|
||||
|
||||
if (sTarget.TrimPrefix(m_pUser->GetStatusPrefix())) {
|
||||
sModCommand = sLine.Token(2, true);
|
||||
} else {
|
||||
sTarget = "status";
|
||||
sModCommand = sLine.Token(1, true);
|
||||
}
|
||||
|
||||
if (sTarget.CaseCmp("status") == 0) {
|
||||
if (sModCommand.empty())
|
||||
PutStatus("Hello. How may I help you?");
|
||||
else
|
||||
UserCommand(sModCommand);
|
||||
} else {
|
||||
#ifdef _MODULES
|
||||
if (sModCommand.empty())
|
||||
CALLMOD(sTarget, this, m_pUser, PutModule("Hello. How may I help you?"))
|
||||
else
|
||||
CALLMOD(sTarget, this, m_pUser, OnModCommand(sModCommand))
|
||||
#endif
|
||||
}
|
||||
return;
|
||||
} else if (sCommand.CaseCmp("DETACH") == 0) {
|
||||
CString sChan = sLine.Token(1);
|
||||
|
||||
Reference in New Issue
Block a user