Skip to content

Commit

Permalink
Merge pull request #33 from call-learning/fix-backport-disabled-notes…
Browse files Browse the repository at this point in the history
…-changes

Fix the disabledNote(s) field for previous releases of the plugin
  • Loading branch information
andrewnicols authored Aug 26, 2024
2 parents 24e7ea9 + cb18d84 commit 17d8efd
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 17d8efd

Please sign in to comment.