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()
 {
     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();
 }
 public function toString()
 {
     $json = parent::toString();
     return '{"ownProperties" : ' . $json . '}';
 }
Example #4
0
 public function update(Response $response)
 {
     $response->setRecipient($this);
     $this->connection->send($response->toString());
 }