summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEvan Prodromou <evan@status.net>2009-12-08 17:42:07 -0500
committerEvan Prodromou <evan@status.net>2009-12-08 17:42:07 -0500
commit9dff9e6cea6c46734de85081856064561a34a501 (patch)
treecaf0fd5d126195b32e7d646b267ab8f2e4eef819
parent5344b3fb4bd48e0559e5ff37b961878ae3a31d3b (diff)
make sure not to forward blocked users
-rw-r--r--classes/Forward.php14
1 files changed, 12 insertions, 2 deletions
diff --git a/classes/Forward.php b/classes/Forward.php
index 52ec53871..e9b83a58b 100644
--- a/classes/Forward.php
+++ b/classes/Forward.php
@@ -77,23 +77,33 @@ class Forward extends Memcached_DataObject
$user = new User();
- $user->query('SELECT id FROM user JOIN subscription ON user.id = subscription.subscriber '.
+ $user->query('SELECT user.* FROM user JOIN subscription ON user.id = subscription.subscriber '.
'WHERE subscription.subscribed = '.$this->profile_id);
$ni = array();
+ $notice = Notice::staticGet('id', $this->notice_id);
+
+ $author = Profile::staticGet('id', $notice->profile_id);
+
while ($user->fetch()) {
$inbox = Notice_inbox::pkeyGet(array('user_id' => $user->id,
'notice_id' => $this->notice_id));
if (empty($inbox)) {
- $ni[$user->id] = NOTICE_INBOX_SOURCE_FORWARD;
+ if (!$user->hasBlocked($author)) {
+ $ni[$user->id] = NOTICE_INBOX_SOURCE_FORWARD;
+ }
} else {
$inbox->free();
}
}
$user->free();
+ $author->free();
+
+ unset($user);
+ unset($author);
Notice_inbox::bulkInsert($this->notice_id, $this->created, $ni);