diff --git a/file/lib/system/chat/permission/ChatPermissionHandler.class.php b/file/lib/system/chat/permission/ChatPermissionHandler.class.php index f61a749..fc3e79e 100644 --- a/file/lib/system/chat/permission/ChatPermissionHandler.class.php +++ b/file/lib/system/chat/permission/ChatPermissionHandler.class.php @@ -16,6 +16,12 @@ */ class ChatPermissionHandler extends \wcf\system\SingletonFactory { protected $chatPermissions = array(); + protected static $defaults = array( + 'user.canEnter' => true, + 'user.canWrite' => true, + 'mod.canAlwaysEnter' => false, + 'mod.canAlwaysWrite' => false + ); /** * @see \wcf\system\SingletonFactory::init() @@ -81,7 +87,9 @@ protected function init() { * @return boolean */ public function getPermission(\wcf\data\chat\room\ChatRoom $room, $permission) { - if (!isset($this->chatPermissions[$room->roomID][$permission])) return true; + if (!isset($this->chatPermissions[$room->roomID][$permission])) { + return isset(self::$defaults[$permission]) ? self::$defaults[$permission] : false; + } return (boolean) $this->chatPermissions[$room->roomID][$permission]; }