prevent to send admin messages to everyone when no admin is connected

This commit is contained in:
Beu 2023-12-22 18:42:20 +01:00
parent 93423e36af
commit e44dfa0ef2
1 changed files with 1 additions and 0 deletions

View File

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