diff options
author | Brion Vibber <brion@pobox.com> | 2010-03-08 10:32:40 -0800 |
---|---|---|
committer | Brion Vibber <brion@pobox.com> | 2010-03-08 10:32:40 -0800 |
commit | a77efb2447abe75d3b9902410bced61b76377de3 (patch) | |
tree | d27ce308ec06ae75e7f48f77a3588e5da2add5a0 /lib | |
parent | 5adb494c26e431948b50690b8efaeedb3f3513d1 (diff) |
XMPP cleanup: fix outgoing XMPP when queuing is disabled; fix notice for first access to undefined member variable
Diffstat (limited to 'lib')
-rw-r--r-- | lib/jabber.php | 34 | ||||
-rw-r--r-- | lib/xmppmanager.php | 1 |
2 files changed, 22 insertions, 13 deletions
diff --git a/lib/jabber.php b/lib/jabber.php index e1bf06ba6..db4e2e9a7 100644 --- a/lib/jabber.php +++ b/lib/jabber.php @@ -88,22 +88,30 @@ class Sharing_XMPP extends XMPPHP_XMPP /** * Build an XMPP proxy connection that'll save outgoing messages * to the 'xmppout' queue to be picked up by xmppdaemon later. + * + * If queueing is disabled, we'll grab a live connection. + * + * @return XMPPHP */ function jabber_proxy() { - $proxy = new Queued_XMPP(common_config('xmpp', 'host') ? - common_config('xmpp', 'host') : - common_config('xmpp', 'server'), - common_config('xmpp', 'port'), - common_config('xmpp', 'user'), - common_config('xmpp', 'password'), - common_config('xmpp', 'resource') . 'daemon', - common_config('xmpp', 'server'), - common_config('xmpp', 'debug') ? - true : false, - common_config('xmpp', 'debug') ? - XMPPHP_Log::LEVEL_VERBOSE : null); - return $proxy; + if (common_config('queue', 'enabled')) { + $proxy = new Queued_XMPP(common_config('xmpp', 'host') ? + common_config('xmpp', 'host') : + common_config('xmpp', 'server'), + common_config('xmpp', 'port'), + common_config('xmpp', 'user'), + common_config('xmpp', 'password'), + common_config('xmpp', 'resource') . 'daemon', + common_config('xmpp', 'server'), + common_config('xmpp', 'debug') ? + true : false, + common_config('xmpp', 'debug') ? + XMPPHP_Log::LEVEL_VERBOSE : null); + return $proxy; + } else { + return jabber_connect(); + } } /** diff --git a/lib/xmppmanager.php b/lib/xmppmanager.php index f37635855..cca54db08 100644 --- a/lib/xmppmanager.php +++ b/lib/xmppmanager.php @@ -36,6 +36,7 @@ class XmppManager extends IoManager protected $site = null; protected $pingid = 0; protected $lastping = null; + protected $conn = null; static protected $singletons = array(); |