diff options
author | Joas Schilling <coding@schilljs.com> | 2019-02-28 21:02:01 +0300 |
---|---|---|
committer | Joas Schilling <coding@schilljs.com> | 2019-03-14 17:41:35 +0300 |
commit | 44619a1aee8cd599143edd12254a98b6425d1d79 (patch) | |
tree | 4e1885fd65480efcc052ffcd165aed7e64ac879e /lib/Room.php | |
parent | 90d081e175ff232dd487cfd5085d10a5cbd28fe2 (diff) |
Readd the left-participant to one-to-one rooms if needed
Signed-off-by: Joas Schilling <coding@schilljs.com>
Diffstat (limited to 'lib/Room.php')
-rw-r--r-- | lib/Room.php | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/lib/Room.php b/lib/Room.php index d8fbedb7a..6d4d3ab72 100644 --- a/lib/Room.php +++ b/lib/Room.php @@ -443,6 +443,25 @@ class Room { return true; } + public function ensureOneToOneRoomIsFilled(): void { + if ($this->getType() !== self::ONE_TO_ONE_CALL) { + return; + } + + if ($this->getName() === '') { + return; + } + + if ($this->manager->isValidParticipant($this->getName())) { + $this->addUsers([ + 'userId' => $this->getName(), + 'participantType' => Participant::OWNER, + ]); + } + + $this->setName(''); + } + /** * @param array[] ...$participants */ |