Skip to content

Commit b14eae5

Browse files
author
RedEnchilada
committed
Fix receiving alerts on replies from blocked users
1 parent 057a4e8 commit b14eae5

File tree

1 file changed

+9
-8
lines changed

1 file changed

+9
-8
lines changed

classes/Notice.php

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1039,14 +1039,15 @@ function whoGets($groups=null, $recipients=null)
10391039
$originalProfile = $original->getProfile();
10401040
}
10411041
}
1042-
foreach ($ni as $id => $source) {
1043-
$user = User::staticGet('id', $id);
1044-
if (empty($user) || $user->hasBlocked($profile) ||
1045-
($originalProfile && $user->hasBlocked($originalProfile))) {
1046-
unset($ni[$id]);
1047-
}
1048-
}
10491042
}
1043+
1044+
foreach ($ni as $id => $source) {
1045+
$user = User::staticGet('id', $id);
1046+
if (empty($user) || $user->hasBlocked($profile) ||
1047+
($originalProfile && $user->hasBlocked($originalProfile))) {
1048+
unset($ni[$id]);
1049+
}
1050+
}
10501051

10511052
// Give plugins a chance to filter out...
10521053
Event::handle('EndNoticeWhoGets', array($this, &$ni));
@@ -1320,7 +1321,7 @@ function saveReplies()
13201321
$original = $this->getOriginal();
13211322
if (!empty($original)) { // that'd be weird
13221323
$author = $original->getProfile();
1323-
if (!empty($author)) {
1324+
if (!empty($author) && !$author->hasBlocked($sender)) {
13241325
$this->saveReply($author->id);
13251326
$replied[$author->id] = 1;
13261327
self::blow('reply:stream:%d', $author->id);

0 commit comments

Comments
 (0)