public function handle($stanza, $parent = false) { $jid = explode('/', (string) $stanza->attributes()->from); $to = current(explode('/', (string) $stanza->attributes()->to)); $evt = new \Event(); if ($stanza->composing) { $evt->runEvent('composing', array($jid[0], $to)); } if ($stanza->paused) { $evt->runEvent('paused', array($jid[0], $to)); } if ($stanza->gone) { $evt->runEvent('gone', array($jid[0], $to)); } if ($stanza->body || $stanza->subject) { $m = new \modl\Message(); $m->set($stanza, $parent); if ($stanza->request) { $from = (string) $stanza->attributes()->from; $id = (string) $stanza->attributes()->id; \Moxl\Stanza\Message::receipt($from, $id); } if (!preg_match('#^\\?OTR#', $m->body)) { $md = new \modl\MessageDAO(); $md->set($m); $this->pack($m); $this->deliver(); } // Can we remove this ? /*if($m->type == 'groupchat' && $m->subject != '') { $evt->runEvent('subject', $m); }*/ } }
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(); } } }
public function request() { $this->store(); if ($this->_muc) { Muc::message($this->_to, $this->_content, $this->_html, $this->_id); } elseif ($this->_encrypted) { Message::encrypted($this->_to, $this->_content, $this->_html, $this->_id, $this->_replace); } else { Message::message($this->_to, $this->_content, $this->_html, $this->_id, $this->_replace); } }
public function request() { Message::paused($this->_to); }
static function message($to, $content) { Message::maker($to, $content, false, 'groupchat'); }
public function request() { Message::composing($this->_to); }
static function message($to, $content, $html = false, $id = false) { Message::maker($to, $content, false, 'groupchat', false, false, $id); }