diff options
author | Evan Prodromou <evan@status.net> | 2010-02-18 07:11:20 -0500 |
---|---|---|
committer | Evan Prodromou <evan@status.net> | 2010-02-18 07:11:20 -0500 |
commit | c2ba7645359242590c8ac60b66f012110ae889ef (patch) | |
tree | 5356629ec8f75182849ebb6b3cb54743ddc16fdc | |
parent | b6e5d4ecc39aa0ee8618e2907aa3ad8f4e9af8a5 (diff) |
always distribute to inbox of author immediately
-rw-r--r-- | classes/Notice.php | 23 |
1 files changed, 22 insertions, 1 deletions
diff --git a/classes/Notice.php b/classes/Notice.php index b0edb6de6..7e2b8b4a6 100644 --- a/classes/Notice.php +++ b/classes/Notice.php @@ -681,7 +681,20 @@ class Notice extends Memcached_DataObject { $ni = $this->whoGets($groups, $recipients); - Inbox::bulkInsert($this->id, array_keys($ni)); + $ids = array_keys($ni); + + // We remove the author (if they're a local user), + // since we'll have already done this in distribute() + + $i = array_search($this->profile_id, $ids); + + if ($i !== false) { + unset($ids[$i]); + } + + // Bulk insert + + Inbox::bulkInsert($this->id, $ids); return; } @@ -1487,6 +1500,14 @@ class Notice extends Memcached_DataObject function distribute() { + // We always insert for the author so they don't + // have to wait + + $user = User::staticGet('id', $this->profile_id); + if (!empty($user)) { + Inbox::insertNotice($user->id, $this->id); + } + if (common_config('queue', 'inboxes')) { // If there's a failure, we want to _force_ // distribution at this point. |