presence() )
return true;
return false;
}
catch(Exception $e)
{
$this->writeLog('ERROR', $e->getMessage());
return false;
}
}
function disconnect()
{
$this->_disconnect();
}
final function readSocket()
{
return $this->read();
}
final function writeSocket($pData)
{
return $this->write($pData);
}
final function setPresence($pPresence)
{
$type = ( isset($pPresence['type']) ) ? $pPresence['type'] : NULL;
$to = ( isset($pPresence['to']) ) ? $pPresence['to'] : NULL;
$show = ( isset($pPresence['show']) ) ? $pPresence['show'] : NULL;
$status = ( isset($pPresence['status']) ) ? $pPresence['status'] : NULL;
$priority = ( isset($pPresence['priority']) ) ? $pPresence['priority'] : NULL;
$this->presence($type, $to, $show, $status, $priority);
}
/*
* Vcard
*/
final function getVcard($pVcard)
{
$this->iq('get', $pVcard, $pVcard, NULL, "vcard-temp", "");
}
final function newVcard($NewVcard)
{
$id = $_SESSION['phpgw_info']['instant_messenger']['user'];
$this->iq('set', $id, NULL, NULL, "vcard-temp", "".$NewVcard."");
}
/*
* Contacts
*/
final function getContacts()
{
$this->iq('get', 'contacts', NULL, NULL, 'jabber:iq:roster');
}
final function addContacts($pContact)
{
$addid = "adduser_" . time();
$this->iq('set', $addid, NULL, NULL, "jabber:iq:roster", $pContact);
}
final function removeContact($pContact)
{
$delid = 'deluser_' . time();
$this->iq('set',$delid,NULL,NULL,"jabber:iq:roster"," ");
}
final function updateContact($pContact)
{
$upid = 'updateuser_' . time();
$this->iq('set', $upid, NULL, NULL, "jabber:iq:roster", $pContact);
}
/*
* Presence
*/
final function SubscriptionAcceptRequest($to = NULL)
{
$this->presence("subscribed", $to);
}
final function SubscriptionDenyRequest($to = NULL)
{
$this->presence("unsubscribed", $to);
}
final function Subscribe($to = NULL)
{
$this->presence("subscribe", $to);
}
final function Unsubscribe($to = NULL)
{
$this->presence("unsubscribe", $to);
}
}
?>