* @revision 05 * @license http://creativecommons.org/licenses/by-sa/3.0/de/ Creative Commons Attribution-Share Alike 3.0 Germany * @homepage http://oss.tiggerswelt.net/xmpp * @copyright Copyright © 2008 tiggersWelt.net **/ /** * Oscar Contact * ------------- * Do some proxying of client-related events on OSCAR-side * * @package tiggerXMPP * @class Oscar_Transport_Contact * @extends OSCAR_Roster_Contact * @revision 01 * @author Bernd Holzmueller **/ class Oscar_Transport_Contact extends OSCAR_Roster_Contact { // {{{ forwardEvent /** * Generic Event-Forwarder * * @param enum $Type * * @access private * @return void **/ private function forwardEvent ($Type) { if (!is_object ($Roster = $this->getRoster ()) || !is_object ($Parent = $Roster->getOscar ()) || !is_object ($XMPP = $Parent->getXMPP ())) return; // Create a basic message $Message = $Parent->createEnvelope ($this->getName ()); $Event = new tiggerXMPP_XML_Tag ($Type, $Message); $Event->setNamespace ("http://jabber.org/protocol/chatstates"); // Forward the event over the XMPP-wire $XMPP->sendXML ($Message); } // }}} // {{{ typingStarted /** * Callback is invoked when user starts typing * * @access public * @return void **/ public function typingStarted () { $this->forwardEvent ("composing"); } // }}} // {{{ typingPaused /** * Callback is invoked when user pauses typing * * @access public * @return void **/ public function typingPaused () { $this->forwardEvent ("paused"); } // }}} // {{{ typingStopped /** * Callback is invoked when user stops typing * * @access public * @return void **/ public function typingStopped () { $this->forwardEvent ("active"); } // }}} // {{{ typingEnded /** * Callback is invoked when user closed chatting-window * * @access public * @return void **/ public function typingEnded () { $this->forwardEvent ("gone"); } // }}} } ?>