Send a default shutdown message if one isn't supplied by the user

git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@560 726aef4b-f618-498e-8847-2d620e286838
This commit is contained in:
prozacx
2005-10-10 15:09:20 +00:00
parent ab95c98407
commit 44647082a7

View File

@@ -515,7 +515,13 @@ void CUserSock::UserCommand(const CString& sLine) {
} else if (m_pUser->IsAdmin() && sCommand.CaseCmp("BROADCAST") == 0) {
CZNC::Get().Broadcast(sLine.Token(1, true));
} else if (m_pUser->IsAdmin() && sCommand.CaseCmp("SHUTDOWN") == 0) {
CZNC::Get().Broadcast(sLine.Token(1, true));
CString sMessage = sLine.Token(1, true);
if (sMessage.empty()) {
sMessage = "ZNC is being shutdown NOW!!";
}
CZNC::Get().Broadcast(sMessage);
usleep(100000); // Sleep for 10ms to attempt to allow the previous Broadcast() to go through to all users
throw CException(CException::EX_Shutdown);