diff options
author | Daniel Calviño Sánchez <danxuliu@gmail.com> | 2021-05-31 21:54:03 +0300 |
---|---|---|
committer | Joas Schilling <coding@schilljs.com> | 2021-06-11 10:07:29 +0300 |
commit | d2c291a1b5253a99685e44e50e951e3ec8fbe184 (patch) | |
tree | 016053370dd6730e4611504fd99f22f602a4aedd /lib/Model | |
parent | d8b4920b3ca12323c05a2049e7acbc33facf8176 (diff) |
Add publishing permissions field to attendees
Guests are not able to fetch the participant list. Due to this the value
is also returned in the room information so clients can know their own
publishing permissions.
Signed-off-by: Daniel Calviño Sánchez <danxuliu@gmail.com>
Diffstat (limited to 'lib/Model')
-rw-r--r-- | lib/Model/Attendee.php | 13 | ||||
-rw-r--r-- | lib/Model/AttendeeMapper.php | 1 | ||||
-rw-r--r-- | lib/Model/SelectHelper.php | 1 |
3 files changed, 15 insertions, 0 deletions
diff --git a/lib/Model/Attendee.php b/lib/Model/Attendee.php index 7766681cd..5a758d4ae 100644 --- a/lib/Model/Attendee.php +++ b/lib/Model/Attendee.php @@ -49,6 +49,8 @@ use OCP\AppFramework\Db\Entity; * @method int getLastMentionMessage() * @method void setReadPrivacy(int $readPrivacy) * @method int getReadPrivacy() + * @method void setPublishingPermissions(int $publishingPermissions) + * @method int getPublishingPermissions() */ class Attendee extends Entity { public const ACTOR_USERS = 'users'; @@ -57,6 +59,12 @@ class Attendee extends Entity { public const ACTOR_EMAILS = 'emails'; public const ACTOR_CIRCLES = 'circles'; + public const PUBLISHING_PERMISSIONS_NONE = 0; + public const PUBLISHING_PERMISSIONS_AUDIO = 1; + public const PUBLISHING_PERMISSIONS_VIDEO = 2; + public const PUBLISHING_PERMISSIONS_SCREENSHARING = 4; + public const PUBLISHING_PERMISSIONS_ALL = 7; + /** @var int */ protected $roomId; @@ -93,6 +101,9 @@ class Attendee extends Entity { /** @var int */ protected $readPrivacy; + /** @var int */ + protected $publishingPermissions; + public function __construct() { $this->addType('roomId', 'int'); $this->addType('actorType', 'string'); @@ -106,6 +117,7 @@ class Attendee extends Entity { $this->addType('lastReadMessage', 'int'); $this->addType('lastMentionMessage', 'int'); $this->addType('readPrivacy', 'int'); + $this->addType('publishingPermissions', 'int'); } public function getDisplayName(): string { @@ -130,6 +142,7 @@ class Attendee extends Entity { 'last_read_message' => $this->getLastReadMessage(), 'last_mention_message' => $this->getLastMentionMessage(), 'read_privacy' => $this->getReadPrivacy(), + 'publishing_permissions' => $this->getPublishingPermissions(), ]; } } diff --git a/lib/Model/AttendeeMapper.php b/lib/Model/AttendeeMapper.php index 1b928fc93..3e8586389 100644 --- a/lib/Model/AttendeeMapper.php +++ b/lib/Model/AttendeeMapper.php @@ -152,6 +152,7 @@ class AttendeeMapper extends QBMapper { 'last_read_message' => (int) $row['last_read_message'], 'last_mention_message' => (int) $row['last_mention_message'], 'read_privacy' => (int) $row['read_privacy'], + 'publishing_permissions' => (int) $row['publishing_permissions'], ]); } } diff --git a/lib/Model/SelectHelper.php b/lib/Model/SelectHelper.php index 3bf0463c8..dfcab988a 100644 --- a/lib/Model/SelectHelper.php +++ b/lib/Model/SelectHelper.php @@ -69,6 +69,7 @@ class SelectHelper { ->addSelect($alias . 'last_read_message') ->addSelect($alias . 'last_mention_message') ->addSelect($alias . 'read_privacy') + ->addSelect($alias . 'publishing_permissions') ->selectAlias($alias . 'id', 'a_id'); } |