* @revision 01 * @license http://creativecommons.org/licenses/by-sa/3.0/de/ Creative Commons Attribution-Share Alike 3 * @homepage http://oss.tiggerswelt.net/xmpp * @copyright Copyright © 2009 tiggersWelt.net */ require_once ("tiggerXMPP/extension.php"); /** * XMPP Chat State Notifications * * @package tiggerXMPP * @class tiggerXMPP_XEP_0085 */ class tiggerXMPP_XEP_0085 extends tiggerXMPP_Extension { const XEP_NAMESPACE = 'http://jabber.org/protocol/chatstates'; // {{{ getTags /** * Retrive a list of all tags we handle for a given namespace * * @param string $Namespace * * @access public * @return array **/ public function getTags ($NS = "") { return array ( "active", "composing", "paused", "inactive", "gone", ); } // }}} // {{{ handle /** * Handle an incoming packet * * @param object $Tag Packet to handle * * @access public * @return object * @todo Add Support for iq set * @todo Add Support for data-Output */ public function handle ($Tag) { // Get parent of the Event if (!is_object ($Parent = $Tag->getParent ())) return; // Determine sender of the event $From = $Parent->getAttribute ('from'); $To = $Parent->getAttribute ('to'); // Multiplex switch ($Tag->getName ()) { case "active": $this->clientActive ($From, $To); break; case "composing": $this->clientComposing ($From, $To); break; case "paused": $this->clientPaused ($From, $To); break; case "inactive": $this->clientInactive ($From, $To); break; case "gone": $this->clientGone ($From, $To); break; } } // }}} // {{{ clientActive /** * Client is active, but not typing * * @param string $JID * @param string $To * * @access protected * @return void **/ protected function clientActive ($JID, $To) { } // }}} // {{{ clientComposing /** * Client started composing * * @param stirng $JID * @param string $To * * @access protected * @return void **/ protected function clientComposing ($JID, $To) { } // }}} // {{{ clientPaused /** * Client temporarily stopped typing * * @param stirng $JID * @param string $To * * @access protected * @return void **/ protected function clientPaused ($JID, $To) { } // }}} // {{{ clientInactive /** * Client is inactive * * @param string $JID * @param string $To * * @access protected * @return void **/ protected function clientInactive ($JID, $To) { } // }}} // {{{ clientGone /** * Client closed its chat-window * * @param stirng $JID * @param string $To * * @access protected * @return void **/ protected function clientGone ($JID, $To) { } // }}} } ?>