mirror of
https://github.com/znc/znc.git
synced 2026-05-05 13:02:31 +02:00
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:
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user