From 77d46ed9929a3d5e4355f6bc807607e7d830a979 Mon Sep 17 00:00:00 2001 From: Michael Hawkins Date: Thu, 5 Oct 2023 15:36:30 +0800 Subject: [PATCH] Always run a called room update to cover custom fields --- communication/classes/api.php | 16 ++++++---------- 1 file changed, 6 insertions(+), 10 deletions(-) diff --git a/communication/classes/api.php b/communication/classes/api.php index 39081d38e5bf5..40d73715b9519 100644 --- a/communication/classes/api.php +++ b/communication/classes/api.php @@ -471,7 +471,6 @@ public function update_room( $roomnamechange = null; $activestatuschange = null; - $roomupdaterequired = false; // Check if the room name is being changed. if ( @@ -479,7 +478,6 @@ public function update_room( $communicationroomname !== $this->communication->get_room_name() ) { $roomnamechange = $communicationroomname; - $roomupdaterequired = true; } // Check if the active status of the provider is being changed. @@ -504,15 +502,13 @@ public function update_room( // Update the avatar. // If the value is `null`, then unset the avatar. - if ($this->set_avatar($avatar)) { - $roomupdaterequired = true; - } + $this->set_avatar($avatar); - if ($roomupdaterequired) { - update_room_task::queue( - $this->communication, - ); - } + // Always queue a room update, even if none of the above standard fields have changed. + // It is possible for providers to have custom fields that have been updated. + update_room_task::queue( + $this->communication, + ); } /**