diff options
author | Joas Schilling <coding@schilljs.com> | 2021-09-29 13:16:42 +0300 |
---|---|---|
committer | Joas Schilling <coding@schilljs.com> | 2021-10-07 19:18:32 +0300 |
commit | 0985260164c188d5d7308c624e335dd3b08ada8b (patch) | |
tree | 4bb2c7f731720172f326bbc5bbcd64e74079ed2e /lib/Model | |
parent | 984c8bd0f1365430464b835d708892a787742999 (diff) |
Move PERMISSIONS_MOFIDY_* constants to Attendee class
Signed-off-by: Joas Schilling <coding@schilljs.com>
Diffstat (limited to 'lib/Model')
-rw-r--r-- | lib/Model/Attendee.php | 4 | ||||
-rw-r--r-- | lib/Model/AttendeeMapper.php | 7 |
2 files changed, 7 insertions, 4 deletions
diff --git a/lib/Model/Attendee.php b/lib/Model/Attendee.php index 3870098b5..d61800c1e 100644 --- a/lib/Model/Attendee.php +++ b/lib/Model/Attendee.php @@ -86,6 +86,10 @@ class Attendee extends Entity { ; public const PERMISSIONS_MAX_CUSTOM = self::PERMISSIONS_MAX_DEFAULT | self::PERMISSIONS_CUSTOM; // Max int (when all permissions are granted as custom) + public const PERMISSIONS_MODIFY_SET = 'set'; + public const PERMISSIONS_MODIFY_REMOVE = 'remove'; + public const PERMISSIONS_MODIFY_ADD = 'add'; + /** @var int */ protected $roomId; diff --git a/lib/Model/AttendeeMapper.php b/lib/Model/AttendeeMapper.php index d5faa5aff..37356a410 100644 --- a/lib/Model/AttendeeMapper.php +++ b/lib/Model/AttendeeMapper.php @@ -23,7 +23,6 @@ declare(strict_types=1); namespace OCA\Talk\Model; -use OCA\Talk\Participant; use OCP\AppFramework\Db\DoesNotExistException; use OCP\AppFramework\Db\MultipleObjectsReturnedException; use OCP\AppFramework\Db\QBMapper; @@ -207,7 +206,7 @@ class AttendeeMapper extends QBMapper { Attendee::ACTOR_GROUPS, ], IQueryBuilder::PARAM_STR_ARRAY))); - if ($mode === Participant::PERMISSIONS_MODIFY_SET) { + if ($mode === Attendee::PERMISSIONS_MODIFY_SET) { $newState |= Attendee::PERMISSIONS_CUSTOM; $query->set('permissions', $query->createNamedParameter($newState, IQueryBuilder::PARAM_INT)); $query->executeStatement(); @@ -221,9 +220,9 @@ class AttendeeMapper extends QBMapper { Attendee::PERMISSIONS_LOBBY_IGNORE, ] as $permission) { if ($permission & $newState) { - if ($mode === Participant::PERMISSIONS_MODIFY_ADD) { + if ($mode === Attendee::PERMISSIONS_MODIFY_ADD) { $this->addSinglePermission($query, $permission); - } elseif ($mode === Participant::PERMISSIONS_MODIFY_REMOVE) { + } elseif ($mode === Attendee::PERMISSIONS_MODIFY_REMOVE) { $this->removeSinglePermission($query, $permission); } } |