public function toString()
 {
     foreach ($this->history as &$responsePart) {
         if (isset($responsePart[Channel::MSG]) && $responsePart[Channel::MSG] instanceof MsgContainer) {
             if (!$this->getRecipient()) {
                 throw new BaseException('Something weird happened: no user was set as recipient');
             }
             $responsePart[Channel::MSG] = $responsePart[Channel::MSG]->getMsg($this->getRecipient()->getLang());
         }
     }
     return parent::toString();
 }
 public function toString()
 {
     $json = parent::toString();
     return '{"ownProperties" : ' . $json . '}';
 }
 public function toString()
 {
     if ($this->msgObj) {
         if (!$this->getRecipient()) {
             throw new BaseException('Something weird happened: no user was set as recipient');
         }
         $user = $this->getRecipient();
         if ($user->getProperties()->hasCensor() && $this->filteredMsgObj) {
             $this->msg = $this->filteredMsgObj->getMsg($user->getLang());
         } else {
             $this->msg = $this->msgObj->getMsg($user->getLang());
         }
     }
     return parent::toString();
 }
 private function traitGuestInfo(Response $response, User $user)
 {
     if ($guests = $response->getGuests()) {
         foreach ($guests as &$guest) {
             if ($user->getBlacklist()->isBanned($guest[PropertiesDAO::USER_ID])) {
                 $guest += ['banned' => $user->getId()];
             }
             if ($note = $user->getUserNotes()->getNote($guest[PropertiesDAO::USER_ID])) {
                 $guest += ['note' => $note];
             }
         }
         $response->setGuestsRaw($guests);
     }
 }
Example #5
0
 public function update(Response $response)
 {
     $response->setRecipient($this);
     $this->connection->send($response->toString());
 }