Merge branch 'master' into 0.9.x

This commit is contained in:
Brion Vibber 2010-01-13 20:51:16 -08:00
commit 255f49067d
1 changed files with 9 additions and 3 deletions

View File

@ -72,7 +72,7 @@ try {
foreach ($ids as $id) { foreach ($ids as $id) {
$user = User::staticGet('id', $id); $user = User::staticGet('id', $id);
if (empty($user)) { if (empty($user)) {
throw new Exception("Can't find user with id '$id'."); print "Can't find user with id '$id'.\n";
} }
initializeInbox($user); initializeInbox($user);
} }
@ -91,14 +91,20 @@ function initializeInbox($user)
print "Initializing inbox for $user->nickname..."; 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 (!empty($inbox)) {
if (!have_option('q', 'quiet')) { if (!have_option('q', 'quiet')) {
print "SKIP\n"; print "SKIP\n";
} }
} else { } else {
$inbox = Inbox::initialize($user_id); $inbox = Inbox::initialize($user->id);
if (!have_option('q', 'quiet')) { if (!have_option('q', 'quiet')) {
if (empty($inbox)) { if (empty($inbox)) {
print "ERR\n"; print "ERR\n";