diff options
author | Evan Prodromou <evan@controlezvous.ca> | 2008-06-26 03:59:20 -0400 |
---|---|---|
committer | Evan Prodromou <evan@controlezvous.ca> | 2008-06-26 03:59:20 -0400 |
commit | 64ba09f9a3bfa4ac4fcba9581d1c581f919c7744 (patch) | |
tree | 61c30f0aa955a91bcd4024029a4596fcffc7faae /lib | |
parent | cdcfdc8cb4f4b5ab0acd1eae9fcd3f5def8578ba (diff) |
handle host !
darcs-hash:20080626075920-34904-0aad06d788f8dbf3a03d17752ba49d866322594e.gz
Diffstat (limited to 'lib')
-rw-r--r-- | lib/common.php | 3 | ||||
-rw-r--r-- | lib/jabber.php | 10 |
2 files changed, 10 insertions, 3 deletions
diff --git a/lib/common.php b/lib/common.php index 18e4ed54a..f8edfdecd 100644 --- a/lib/common.php +++ b/lib/common.php @@ -63,7 +63,8 @@ $config = 'port' => 5222, 'user' => 'update', 'resource' => 'uniquename', - 'password' => 'blahblahblah'), + 'password' => 'blahblahblah', + 'host' => NULL), # only set if != server ); $config['db'] = &PEAR::getStaticProperty('DB_DataObject','options'); diff --git a/lib/jabber.php b/lib/jabber.php index 4f0335f91..364282a1c 100644 --- a/lib/jabber.php +++ b/lib/jabber.php @@ -37,7 +37,7 @@ function jabber_normalize_jid($jid) { } } -function jabber_connect($resource=NULL) { +function jabber_connect($resource=NULL, $status=NULL) { static $conn = NULL; if (!$conn) { $conn = new XMPP(common_config('xmpp', 'server'), @@ -45,7 +45,10 @@ function jabber_connect($resource=NULL) { common_config('xmpp', 'user'), common_config('xmpp', 'password'), ($resource) ? $resource : - common_config('xmpp', 'resource')); + common_config('xmpp', 'resource'), + common_config('xmpp', 'host') ? + common_config('xmpp', 'host') : + common_config('xmpp', 'server')); if (!$conn) { return false; @@ -55,6 +58,9 @@ function jabber_connect($resource=NULL) { return false; } $conn->processUntil('session_start'); + if ($status) { + $conn->presence($status); + } } return $conn; } |