Exemplo n.º 1
0
 public function build(Identifier $identifier, Session $session, Handler $handler, PresenceManager $presenceManager, bool $permanent)
 {
     $keyValueStore = $this->keyValueStorageFactory->build($identifier->getIdentString());
     return new Room($identifier, $session, $handler, $presenceManager, $keyValueStore, $permanent);
 }
Exemplo n.º 2
0
 public function isApproved(Identifier $identifier) : Promise
 {
     return isset($this->permanentRooms[$identifier->getIdentString()]) ? new Success(true) : $this->enqueueAction([$this, 'checkIfRoomIsApproved'], $identifier);
 }
Exemplo n.º 3
0
 public function isApproved(ChatRoomIdentifier $identifier) : Promise
 {
     return resolve(function () use($identifier) {
         $data = (yield $this->accessor->read($this->dataFileTemplate));
         return $data[$identifier->getIdentString()]['is_approved'] ?? false;
     });
 }