Skip to content

Commit

Permalink
Always run a called room update to cover custom fields
Browse files Browse the repository at this point in the history
  • Loading branch information
mickhawkins committed Oct 5, 2023
1 parent af7d398 commit 77d46ed
Showing 1 changed file with 6 additions and 10 deletions.
16 changes: 6 additions & 10 deletions communication/classes/api.php
Original file line number Diff line number Diff line change
Expand Up @@ -471,15 +471,13 @@ public function update_room(

$roomnamechange = null;
$activestatuschange = null;
$roomupdaterequired = false;

// Check if the room name is being changed.
if (
$communicationroomname !== null &&
$communicationroomname !== $this->communication->get_room_name()
) {
$roomnamechange = $communicationroomname;
$roomupdaterequired = true;
}

// Check if the active status of the provider is being changed.
Expand All @@ -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,
);
}

/**
Expand Down

0 comments on commit 77d46ed

Please sign in to comment.