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:
kroimon
2008-09-29 13:33:15 +00:00
parent 8c2fc5180e
commit 051e1f81d8

View File

@@ -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);