diff options
author | Evan Prodromou <evan@prodromou.name> | 2008-08-30 04:44:23 -0400 |
---|---|---|
committer | Evan Prodromou <evan@prodromou.name> | 2008-08-30 04:44:23 -0400 |
commit | 6c42bdc4480be3e5248550225f531a52c28cb050 (patch) | |
tree | 22f812e9f8759707a41e2a2703610130d5b7d7bd /lib/jabber.php | |
parent | 55816cf24ea6e54881c54c890d3ffe751e6e65fb (diff) |
get rid of Laconica_XMPP and ignore priority
darcs-hash:20080830084423-84dde-7749d00c4c2fcada9e0f30af044637c48c0512c3.gz
Diffstat (limited to 'lib/jabber.php')
-rw-r--r-- | lib/jabber.php | 33 |
1 files changed, 3 insertions, 30 deletions
diff --git a/lib/jabber.php b/lib/jabber.php index 6479968b3..f89def25e 100644 --- a/lib/jabber.php +++ b/lib/jabber.php @@ -21,33 +21,6 @@ if (!defined('LACONICA')) { exit(1); } require_once('XMPPHP/XMPP.php'); -# XXX: something of a hack to work around problems with the XMPPHP lib - -class Laconica_XMPP extends XMPPHP_XMPP { - - public function presence($status = null, $show = 'available', $to = null, $type='available', $priority=NULL) { - if($type == 'available') $type = ''; - $to = htmlspecialchars($to); - $status = htmlspecialchars($status); - if($show == 'unavailable') $type = 'unavailable'; - - $out = "<presence"; - if($to) $out .= " to='$to'"; - if($type) $out .= " type='$type'"; - if($show == 'available' and !$status and is_null($priority)) { - $out .= "/>"; - } else { - $out .= ">"; - if($show != 'available') $out .= "<show>$show</show>"; - if($status) $out .= "<status>$status</status>"; - if(!is_null($priority)) $out .= "<priority>$priority</priority>"; - $out .= "</presence>"; - } - - $this->send($out); - } -} - function jabber_valid_base_jid($jid) { # Cheap but effective return Validate::email($jid); @@ -70,7 +43,7 @@ function jabber_daemon_address() { function jabber_connect($resource=NULL, $status=NULL, $priority=NULL) { static $conn = NULL; if (!$conn) { - $conn = new Laconica_XMPP(common_config('xmpp', 'host') ? + $conn = new XMPPHP_XMPP(common_config('xmpp', 'host') ? common_config('xmpp', 'host') : common_config('xmpp', 'server'), common_config('xmpp', 'port'), @@ -95,8 +68,8 @@ function jabber_connect($resource=NULL, $status=NULL, $priority=NULL) { return false; } $conn->processUntil('session_start'); - $conn->getRoster(); - $conn->presence($presence, 'available', NULL, 'available', $priority); +# $conn->getRoster(); + $conn->presence($presence, 'available', NULL, 'available'); } return $conn; } |