summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--config.php.sample9
-rw-r--r--install.php2
-rw-r--r--lib/jabber.php34
-rw-r--r--lib/queued_xmpp.php18
-rw-r--r--lib/xmppmanager.php1
5 files changed, 38 insertions, 26 deletions
diff --git a/config.php.sample b/config.php.sample
index 33ac94a6d..3d2a52bec 100644
--- a/config.php.sample
+++ b/config.php.sample
@@ -188,9 +188,6 @@ $config['sphinx']['port'] = 3312;
// Disable SMS
// $config['sms']['enabled'] = false;
-// Disable Twitter integration
-// $config['twitter']['enabled'] = false;
-
// Twitter integration source attribute. Note: default is StatusNet
// $config['integration']['source'] = 'StatusNet';
@@ -198,7 +195,7 @@ $config['sphinx']['port'] = 3312;
//
// NOTE: if you enable this you must also set $config['avatar']['path']
//
-// $config['twitterbridge']['enabled'] = true;
+// $config['twitterimport']['enabled'] = true;
// Twitter OAuth settings
// $config['twitter']['consumer_key'] = 'YOURKEY';
@@ -212,10 +209,6 @@ $config['sphinx']['port'] = 3312;
// $config['throttle']['count'] = 100;
// $config['throttle']['timespan'] = 3600;
-// List of users banned from posting (nicknames and/or IDs)
-// $config['profile']['banned'][] = 'hacker';
-// $config['profile']['banned'][] = 12345;
-
// Config section for the built-in Facebook application
// $config['facebook']['apikey'] = 'APIKEY';
// $config['facebook']['secret'] = 'SECRET';
diff --git a/install.php b/install.php
index 7fece8999..929277e5e 100644
--- a/install.php
+++ b/install.php
@@ -308,7 +308,7 @@ function checkPrereqs()
printf('<p class="error">PHP is linked to a version of the PCRE library ' .
'that does not support Unicode properties. ' .
'If you are running Red Hat Enterprise Linux / ' .
- 'CentOS 5.3 or earlier, see <a href="' .
+ 'CentOS 5.4 or earlier, see <a href="' .
'http://status.net/wiki/Red_Hat_Enterprise_Linux#PCRE_library' .
'">our documentation page</a> on fixing this.</p>');
$pass = false;
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/queued_xmpp.php b/lib/queued_xmpp.php
index fdd074db2..f6bccfd5b 100644
--- a/lib/queued_xmpp.php
+++ b/lib/queued_xmpp.php
@@ -49,10 +49,20 @@ class Queued_XMPP extends XMPPHP_XMPP
*/
public function __construct($host, $port, $user, $password, $resource, $server = null, $printlog = false, $loglevel = null)
{
- parent::__construct($host, $port, $user, $password, $resource, $server, $printlog, $loglevel);
- // Normally the fulljid isn't filled out until resource binding time;
- // we need to save it here since we're not talking to a real server.
- $this->fulljid = "{$this->basejid}/{$this->resource}";
+ parent::__construct($host, $port, $user, $password, $resource, $server, $printlog, $loglevel);
+
+ // We use $host to connect, but $server to build JIDs if specified.
+ // This seems to fix an upstream bug where $host was used to build
+ // $this->basejid, never seen since it isn't actually used in the base
+ // classes.
+ if (!$server) {
+ $server = $this->host;
+ }
+ $this->basejid = $this->user . '@' . $server;
+
+ // Normally the fulljid is filled out by the server at resource binding
+ // time, but we need to do it since we're not talking to a real server.
+ $this->fulljid = "{$this->basejid}/{$this->resource}";
}
/**
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();