* * @version 1.0 * @date 30 August 2010 * * Copyright (C)2010 MOVIM project * * See COPYING for licensing information. */ class Roster extends WidgetBase { function WidgetLoad() { $this->addcss('roster.css'); $this->addjs('roster.js'); $this->registerEvent('roster', 'onRoster'); $this->registerEvent('presence', 'onPresence'); $this->registerEvent('vcard', 'onVcard'); } function onPresence($presence) { $arr = $presence->getPresence(); $tab = PresenceHandler::getPresence($arr['jid'], true); RPC::call('incomingPresence', RPC::cdata($tab['jid']), RPC::cdata($tab['presence_txt'])); } function onVcard($contact) { $html = $this->prepareRosterElement($contact, true); RPC::call('movim_fill', 'roster'.$contact->getData('jid'), RPC::cdata($html)); } function onRoster() { $html = $this->prepareRoster(); RPC::call('movim_fill', 'rosterlist', RPC::cdata($html)); RPC::call('sortRoster'); } function ajaxRefreshRoster() { $this->xmpp->getRosterList(); } function prepareRosterElement($contact, $inner = false) { $presence = PresenceHandler::getPresence($contact->getData('jid'), true); $start = '