From aad5b7ee5fa30a0da68983b959dc5542741302b1 Mon Sep 17 00:00:00 2001 From: David Woloszyn Date: Wed, 7 Feb 2024 14:09:39 +1100 Subject: [PATCH] MDL-80832 communication_matrix: Fix regression caused by MDL-80403 --- .../provider/matrix/classes/communication_feature.php | 11 +---------- 1 file changed, 1 insertion(+), 10 deletions(-) diff --git a/communication/provider/matrix/classes/communication_feature.php b/communication/provider/matrix/classes/communication_feature.php index 5becbfb6ca8..18c88f07fa7 100644 --- a/communication/provider/matrix/classes/communication_feature.php +++ b/communication/provider/matrix/classes/communication_feature.php @@ -599,12 +599,6 @@ class communication_feature implements $currentpowerlevels = $this->get_current_powerlevel_data(); $currentuserpowerlevels = (array) $currentpowerlevels->users ?? []; - // Ensure each user entry is an array. - $currentuserpowerlevels = array_map( - fn ($user) => (array) $user, - $currentuserpowerlevels, - ); - // Get all the current users who need to be in the room. $userlist = $this->processor->get_all_userids_for_instance(); @@ -663,10 +657,7 @@ class communication_feature implements private function get_users_with_custom_power_level(array $users): array { return array_filter( $users, - function ($user): bool { - // Isolate the level value. - $level = array_values($user); - $level = reset($level); + function ($level): bool { switch ($level) { case matrix_constants::POWER_LEVEL_DEFAULT: case matrix_constants::POWER_LEVEL_MOODLE_SITE_ADMIN: