We are no longer offering accounts on this server. Consider https://gitlab.freedesktop.org/ as a place to host projects.

Commit b59188dc authored by Evan Prodromou's avatar Evan Prodromou

Merge branch 'master' into 0.9.x

parents 33df3922 16742d0f
......@@ -103,9 +103,9 @@ class Inbox extends Memcached_DataObject
static function insertNotice($user_id, $notice_id)
{
$inbox = Inbox::staticGet('user_id', $user_id);
$inbox = DB_DataObject::staticGet('inbox', 'user_id', $user_id);
if (empty($inbox) || $inbox->fake) {
if (empty($inbox)) {
$inbox = Inbox::initialize($user_id);
}
......@@ -153,8 +153,19 @@ class Inbox extends Memcached_DataObject
$ids = unpack('N*', $inbox->notice_ids);
// XXX: handle since_id
// XXX: handle max_id
if (!empty($since_id)) {
$i = array_search($since_id, $ids);
if ($i !== false) {
$ids = array_slice($ids, 0, $i - 1);
}
}
if (!empty($max_id)) {
$i = array_search($max_id, $ids);
if ($i !== false) {
$ids = array_slice($ids, $i - 1);
}
}
$ids = array_slice($ids, $offset, $limit);
......
......@@ -231,7 +231,7 @@ class IoMaster
return -1;
}
} else {
return $this->parseMemoryLimit($limit);
return $this->parseMemoryLimit($softLimit);
}
return $softLimit;
}
......
......@@ -81,7 +81,7 @@ class XmppManager extends IoManager
parent::start($master);
$this->switchSite();
require_once "lib/jabber.php";
require_once INSTALLDIR . "/lib/jabber.php";
# Low priority; we don't want to receive messages
......
......@@ -166,7 +166,7 @@ class MemcachePlugin extends Plugin
if (is_array($this->servers)) {
foreach ($this->servers as $server) {
list($host, $port) = explode(';', $server);
list($host, $port) = @explode(';', $server);
if (empty($port)) {
$port = 11211;
}
......
......@@ -72,7 +72,7 @@ try {
foreach ($ids as $id) {
$user = User::staticGet('id', $id);
if (empty($user)) {
throw new Exception("Can't find user with id '$id'.");
print "Can't find user with id '$id'.\n";
}
initializeInbox($user);
}
......@@ -91,14 +91,20 @@ function initializeInbox($user)
print "Initializing inbox for $user->nickname...";
}
$inbox = Inbox::staticGet('user_id', $user_id);
$inbox = Inbox::staticGet('user_id', $user->id);
if ($inbox && !empty($inbox->fake)) {
if (!have_option('q', 'quiet')) {
echo "(replacing faux cached inbox)";
}
$inbox = false;
}
if (!empty($inbox)) {
if (!have_option('q', 'quiet')) {
print "SKIP\n";
}
} else {
$inbox = Inbox::initialize($user_id);
$inbox = Inbox::initialize($user->id);
if (!have_option('q', 'quiet')) {
if (empty($inbox)) {
print "ERR\n";
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment