From e44dfa0ef294ea84daa9d84fa75b839a544ce3ad Mon Sep 17 00:00:00 2001 From: Beu Date: Fri, 22 Dec 2023 18:42:20 +0100 Subject: [PATCH] prevent to send admin messages to everyone when no admin is connected --- core/Chat.php | 1 + 1 file changed, 1 insertion(+) diff --git a/core/Chat.php b/core/Chat.php index ee06ae9e..aecf0477 100644 --- a/core/Chat.php +++ b/core/Chat.php @@ -351,6 +351,7 @@ class Chat implements CallbackListener, CommunicationListener, UsageInformationA */ public function sendMessageToAdmins($message, $minLevel = AuthenticationManager::AUTH_LEVEL_MODERATOR, $prefix = true) { $admins = $this->maniaControl->getAuthenticationManager()->getConnectedAdmins($minLevel); + if (count($admins) === 0) return false; return $this->sendChat($message, $admins, $prefix); }