コード例 #1
0
ファイル: Message.php プロジェクト: movim/moxl
 public function handle($stanza, $parent = false)
 {
     $jid = explode('/', (string) $stanza->attributes()->from);
     $to = current(explode('/', (string) $stanza->attributes()->to));
     if ($stanza->composing) {
         $this->event('composing', array($jid[0], $to));
     }
     if ($stanza->paused) {
         $this->event('paused', array($jid[0], $to));
     }
     if ($stanza->gone) {
         $this->event('gone', array($jid[0], $to));
     }
     if ($stanza->body || $stanza->subject) {
         if ($stanza->request) {
             $from = (string) $stanza->attributes()->from;
             $id = (string) $stanza->attributes()->id;
             \Moxl\Stanza\Message::receipt($from, $id);
         }
         $m = new \Modl\Message();
         $m->set($stanza, $parent);
         if (!preg_match('#^\\?OTR#', $m->body)) {
             $md = new \Modl\MessageDAO();
             $md->set($m);
             $this->pack($m);
             $this->deliver();
         }
     }
 }
コード例 #2
0
ファイル: Carbons.php プロジェクト: movim/moxl
 public function handle($stanza, $parent = false)
 {
     $message = $stanza->forwarded->message;
     $jid = explode('/', (string) $message->attributes()->from);
     $to = current(explode('/', (string) $message->attributes()->to));
     if ($message->composing) {
         $this->event('composing', array($jid[0], $to));
     }
     if ($message->paused) {
         $this->event('paused', array($jid[0], $to));
     }
     if ($message->gone) {
         $this->event('gone', array($jid[0], $to));
     }
     if ($message->body || $message->subject) {
         $m = new \Modl\Message();
         $m->set($message, $stanza->forwarded);
         if (!preg_match('#^\\?OTR#', $m->body)) {
             $md = new \Modl\MessageDAO();
             $md->set($m);
             $this->pack($m);
             $this->deliver();
         }
     }
 }
コード例 #3
0
ファイル: MAMResult.php プロジェクト: movim/moxl
 public function handle($stanza, $parent = false)
 {
     if ($stanza->forwarded->delay) {
         $m = new \Modl\Message();
         $m->set($stanza->forwarded->message, $stanza->forwarded);
         if (!preg_match('#^\\?OTR#', $m->body)) {
             $md = new \Modl\MessageDAO();
             $md->set($m);
             $this->pack($m);
             $this->deliver();
         }
     }
 }