Skip to content

Commit

Permalink
Fix the disabledNote(s) field for previous releases of the plugin
Browse files Browse the repository at this point in the history
* We need to now use disabledNotes but still allow for disabledNote field
  • Loading branch information
laurentdavid committed Aug 26, 2024
1 parent 24e7ea9 commit cb18d84
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 1 deletion.
3 changes: 2 additions & 1 deletion application/src/Controller/ApiController.php
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,8 @@ public function meetingEnd(string $serverID, Request $request): XmlResponse
'disableMic',
'disablePrivateChat',
'disablePublicChat',
'disableNotes',
'disableNotes', // This is the real name of the setting (see MDL-82389).
'disableNote', // This was the previous name (a typo), but we need to keep it here for backward compatibility.
'lockedLayout',
'hideUserList',
'lockOnJoin',
Expand Down
8 changes: 8 additions & 0 deletions application/src/Entity/Meeting.php
Original file line number Diff line number Diff line change
Expand Up @@ -619,13 +619,21 @@ public function setLockSetting(string $lockName, bool $value) {
if (property_exists($this, $lockName)) {
$this->$lockName = $value;
}
// Keep the old behavior for disableNote.
if ($lockName === 'disableNote') {
$this->disableNotes = $value;
}
}

public function getLockSetting(string $lockName): bool {
if (property_exists($this, $lockName)) {
// If lockOnJoin not set to true, this is false for every lock.
return $this->lockOnJoin && $this->$lockName;
}
// Keep the old behavior for disableNote.
if ($lockName === 'disableNote') {
return $this->disableNotes;
}
return false;
}

Expand Down

0 comments on commit cb18d84

Please sign in to comment.