summaryrefslogtreecommitdiff
path: root/lib/jabber.php
diff options
context:
space:
mode:
authorEvan Prodromou <evan@prodromou.name>2008-09-01 21:26:04 -0400
committerEvan Prodromou <evan@prodromou.name>2008-09-01 21:26:04 -0400
commitc6c3cd40f6304b49f5d4841e9999641a183e987b (patch)
tree677e174fae15399a510ab7ed65bfd4148b8f0f11 /lib/jabber.php
parentc31afa795f7077a8d007e0a426cd0910980e1ee5 (diff)
separate out presence from connection, send different presence types from queuehandlers
darcs-hash:20080902012604-84dde-073a583da9b09c80e5e9a47a5eddd144fad8e87a.gz
Diffstat (limited to 'lib/jabber.php')
-rw-r--r--lib/jabber.php10
1 files changed, 5 insertions, 5 deletions
diff --git a/lib/jabber.php b/lib/jabber.php
index 22e2d11b3..3e74cbbb8 100644
--- a/lib/jabber.php
+++ b/lib/jabber.php
@@ -40,7 +40,7 @@ function jabber_daemon_address() {
return common_config('xmpp', 'user') . '@' . common_config('xmpp', 'server');
}
-function jabber_connect($resource=NULL, $status=NULL, $priority=NULL) {
+function jabber_connect($resource=NULL) {
static $conn = NULL;
if (!$conn) {
$conn = new XMPPHP_XMPP(common_config('xmpp', 'host') ?
@@ -68,8 +68,6 @@ function jabber_connect($resource=NULL, $status=NULL, $priority=NULL) {
return false;
}
$conn->processUntil('session_start');
-# $conn->getRoster();
- $conn->presence($presence, 'available', NULL, 'available', $priority);
}
return $conn;
}
@@ -149,12 +147,14 @@ function jabber_send_message($to, $body, $type='chat', $subject=NULL) {
return true;
}
-function jabber_send_presence($status, $show='available', $to=Null) {
+function jabber_send_presence($status, $show='available', $to=NULL,
+ $type = 'available', $priority=NULL)
+{
$conn = jabber_connect();
if (!$conn) {
return false;
}
- $conn->presence($status, $show, $to);
+ $conn->presence($status, $show, $to, $type, $priority);
return true;
}