Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/nextcloud/spreed.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/lib/Model
diff options
context:
space:
mode:
authorJoas Schilling <coding@schilljs.com>2020-10-30 16:03:37 +0300
committerJoas Schilling <coding@schilljs.com>2020-11-26 11:46:43 +0300
commit459858a69527311bf60ffa553d45ba2a7eeec032 (patch)
treea25ef253ccc64b9b8da3e7c7597a55c8495f3c4f /lib/Model
parent89f3f351962c2183d1cfeadedd2b6916d7958bc3 (diff)
Introduce constants for the actor types
Signed-off-by: Joas Schilling <coding@schilljs.com>
Diffstat (limited to 'lib/Model')
-rw-r--r--lib/Model/Attendee.php4
-rw-r--r--lib/Model/Message.php2
2 files changed, 5 insertions, 1 deletions
diff --git a/lib/Model/Attendee.php b/lib/Model/Attendee.php
index 121139d15..8725c365d 100644
--- a/lib/Model/Attendee.php
+++ b/lib/Model/Attendee.php
@@ -51,6 +51,10 @@ use OCP\AppFramework\Db\Entity;
*/
class Attendee extends Entity {
+ public const ACTOR_USERS = 'users';
+ public const ACTOR_GUESTS = 'guests';
+ public const ACTOR_EMAILS = 'emails';
+
/** @var int */
protected $roomId;
diff --git a/lib/Model/Message.php b/lib/Model/Message.php
index 6d54f04c5..97d578c18 100644
--- a/lib/Model/Message.php
+++ b/lib/Model/Message.php
@@ -158,7 +158,7 @@ class Message {
public function isReplyable(): bool {
return $this->getMessageType() !== 'system' &&
$this->getMessageType() !== 'command' &&
- \in_array($this->getActorType(), ['users', 'guests']);
+ \in_array($this->getActorType(), [Attendee::ACTOR_USERS, Attendee::ACTOR_GUESTS]);
}
public function toArray(): array {