From: Craig Andrews Date: Mon, 8 Mar 2010 22:22:23 +0000 (-0500) Subject: Merge branch '0.9.x' into 1.0.x X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=714d920faea302b55857cc3bec4e9e6160ea136a;p=quix0rs-gnu-social.git Merge branch '0.9.x' into 1.0.x Conflicts: classes/statusnet.ini db/statusnet.sql lib/jabber.php lib/xmppmanager.php --- 714d920faea302b55857cc3bec4e9e6160ea136a diff --cc db/statusnet.sql index d6f0f54a2d,3f95948e1e..d1cd670750 --- a/db/statusnet.sql +++ b/db/statusnet.sql @@@ -650,3 -645,14 +655,13 @@@ create table conversation created datetime not null comment 'date this record was created', modified timestamp comment 'date this record was modified' ) ENGINE=InnoDB CHARACTER SET utf8 COLLATE utf8_bin; + + create table local_group ( + + group_id integer primary key comment 'group represented' references user_group (id), + nickname varchar(64) unique key comment 'group represented', + + created datetime not null comment 'date this record was created', + modified timestamp comment 'date this record was modified' + + ) ENGINE=InnoDB CHARACTER SET utf8 COLLATE utf8_bin; - diff --cc lib/statusnet.php index 3f9a48e6ab,ef3adebf94..afb8f5af02 --- a/lib/statusnet.php +++ b/lib/statusnet.php @@@ -339,9 -339,14 +339,13 @@@ class StatusNe } // Backwards compatibility - if (array_key_exists('memcached', $config)) { if ($config['memcached']['enabled']) { - addPlugin('Memcache', array('servers' => $config['memcached']['server'])); + if(class_exists('Memcached')) { + addPlugin('Memcached', array('servers' => $config['memcached']['server'])); + } else { + addPlugin('Memcache', array('servers' => $config['memcached']['server'])); + } } if (!empty($config['memcached']['base'])) { diff --cc plugins/Xmpp/Fake_XMPP.php index a0f329ca08,0000000000..0f7cfd3b4d mode 100644,000000..100644 --- a/plugins/Xmpp/Fake_XMPP.php +++ b/plugins/Xmpp/Fake_XMPP.php @@@ -1,104 -1,0 +1,114 @@@ +. + * + * @category Network + * @package StatusNet + * @author Brion Vibber + * @copyright 2010 StatusNet, Inc. + * @license http://www.fsf.org/licensing/licenses/agpl-3.0.html GNU Affero General Public License version 3.0 + * @link http://status.net/ + */ + +if (!defined('STATUSNET') && !defined('LACONICA')) { + exit(1); +} + +class Fake_XMPP extends XMPPHP_XMPP +{ + public $would_be_sent = null; + + /** + * Constructor + * + * @param string $host + * @param integer $port + * @param string $user + * @param string $password + * @param string $resource + * @param string $server + * @param boolean $printlog + * @param string $loglevel + */ + 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}"; + } + + /** + * Send a formatted message to the outgoing queue for later forwarding + * to a real XMPP connection. + * + * @param string $msg + */ + public function send($msg, $timeout=NULL) + { + $this->would_be_sent = $msg; + } + + //@{ + /** + * Stream i/o functions disabled; only do output + */ + public function connect($timeout = 30, $persistent = false, $sendinit = true) + { + throw new Exception("Can't connect to server from fake XMPP."); + } + + public function disconnect() + { + throw new Exception("Can't connect to server from fake XMPP."); + } + + public function process() + { + throw new Exception("Can't read stream from fake XMPP."); + } + + public function processUntil($event, $timeout=-1) + { + throw new Exception("Can't read stream from fake XMPP."); + } + + public function read() + { + throw new Exception("Can't read stream from fake XMPP."); + } + + public function readyToProcess() + { + throw new Exception("Can't read stream from fake XMPP."); + } + //@} +} +