* @revision 05 * @license http://creativecommons.org/licenses/by-sa/3.0/de/ Creative Commons Attribution-Share Alike G * @homepage http://oss.tiggerswelt.net/xmpp * @copyright Copyright © 2008 tiggersWelt.net **/ require_once ("tiggerXMPP/xep/0085.php"); class XMPP_ICQ_MTN extends tiggerXMPP_XEP_0085 { // {{{ forwardEvent /** * Forward a typing-event to OSCAR * * @param string $JID * @param string $To * @param int $Event * * @access private * @return void **/ private function forwardEvent ($JID, $To, $Event) { // Load instance of our parent if (!is_object ($Parent = $this->getParent ())) return; // Load oscar-instance for this client if (!is_object ($Client = $Parent->getOscar ($JID))) return; // Create the event and submit $SNAC = new Oscar_SNAC_ICBM_Notifycation ($Client); $SNAC->Username = intval ($Parent->getJID (true, false, false, $To)); $SNAC->Type = $Event; $SNAC->writeFlap (); } // }}} // {{{ clientActive /** * Client is active, but not typing * * @param string $JID * @param string $To * * @access protected * @return void **/ protected function clientActive ($JID, $To) { self::forwardEvent ($JID, $To, Oscar_SNAC_ICBM_Notifycation::EVENT_NONE); } // }}} // {{{ clientComposing /** * Client started composing * * @param stirng $JID * @param string $To * * @access protected * @return void **/ protected function clientComposing ($JID, $To) { self::forwardEvent ($JID, $To, Oscar_SNAC_ICBM_Notifycation::EVENT_TYPING); } // }}} // {{{ clientPaused /** * Client temporarily stopped typing * * @param stirng $JID * @param string $To * * @access protected * @return void **/ protected function clientPaused ($JID, $To) { self::forwardEvent ($JID, $To, Oscar_SNAC_ICBM_Notifycation::EVENT_TYPED); } // }}} // {{{ clientGone /** * Client closed its chat-window * * @param stirng $JID * @param string $To * * @access protected * @return void **/ protected function clientGone ($JID, $To) { self::forwardEvent ($JID, $To, Oscar_SNAC_ICBM_Notifycation::EVENT_CLOSED); } // }}} } ?>