]> git.mxchange.org Git - quix0rs-gnu-social.git/commitdiff
Merge commit 'origin/master' into testing
authorBrion Vibber <brion@pobox.com>
Tue, 9 Mar 2010 19:27:30 +0000 (11:27 -0800)
committerBrion Vibber <brion@pobox.com>
Tue, 9 Mar 2010 19:27:30 +0000 (11:27 -0800)
config.php.sample
install.php
lib/jabber.php
lib/queued_xmpp.php
lib/xmppmanager.php

index 33ac94a6d09d123abaa1fc7088406e6dfad095ba..3d2a52beccefe943824a80a289589df4a8a6c652 100644 (file)
@@ -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';
index 7fece8999fe7bcf3ee644086c5543e114d807f69..929277e5e857422a199233bb78141bd49387d59e 100644 (file)
@@ -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;
index e1bf06ba661bfc8a8e29bdc30637c5f3d8b22032..db4e2e9a706a62f8bf905e4b34167f37416492f3 100644 (file)
@@ -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();
+    }
 }
 
 /**
index fdd074db2996e422e934d1efa473d1df514b1526..f6bccfd5ba40ddbac9cc0edcb80b478dbdf34dc6 100644 (file)
@@ -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}";
     }
 
     /**
index f376358555ab1aa4f442da174925fa01e6add3e7..cca54db08da4b4a016354ffa1b685564c9900fe8 100644 (file)
@@ -36,6 +36,7 @@ class XmppManager extends IoManager
     protected $site = null;
     protected $pingid = 0;
     protected $lastping = null;
+    protected $conn = null;
 
     static protected $singletons = array();