diff options
Diffstat (limited to 'extlib/XMPPHP')
-rw-r--r-- | extlib/XMPPHP/XMPP.php | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/extlib/XMPPHP/XMPP.php b/extlib/XMPPHP/XMPP.php index d7783b516..cf4e7acd9 100644 --- a/extlib/XMPPHP/XMPP.php +++ b/extlib/XMPPHP/XMPP.php @@ -164,7 +164,7 @@ class XMPPHP_XMPP extends XMPPHP_XMLStream { * @param string $show * @param string $to */ - public function presence($status = null, $show = 'available', $to = null, $type='available') { + public function presence($status = null, $show = 'available', $to = null, $type='available', $priority=NULL) { if($type == 'available') $type = ''; $to = htmlspecialchars($to); $status = htmlspecialchars($status); @@ -173,12 +173,13 @@ class XMPPHP_XMPP extends XMPPHP_XMLStream { $out = "<presence"; if($to) $out .= " to='$to'"; if($type) $out .= " type='$type'"; - if($show == 'available' and !$status) { + 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>"; } |