summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEvan Prodromou <evan@prodromou.name>2008-08-30 05:14:30 -0400
committerEvan Prodromou <evan@prodromou.name>2008-08-30 05:14:30 -0400
commit377115cad3b0e3945ee6ca5aa35e001be6f6946c (patch)
tree99670038aedcf86c329bfe3d07899bd5445cae88
parent2860313f4bb13344cfd53e197c9dbdb976a0b21e (diff)
make XMPP take a priority for presence
darcs-hash:20080830091430-84dde-cb0bc7d8957fd295c823298b137c4cf4b285f689.gz
-rw-r--r--extlib/XMPPHP/XMPP.php5
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>";
}