mark: A photo of Mark kneeling on top of the Taal Volcano in the Philippines. It was a long hike. (Default)
Mark Smith ([staff profile] mark) wrote in [site community profile] changelog2012-06-15 02:30 am

[dw-free] http://bugs.dwscoalition.org/show_bug.cgi?id=4440

[commit: http://hg.dwscoalition.org/dw-free/rev/9d72c2a977cf]

http://bugs.dwscoalition.org/show_bug.cgi?id=4440

Don't send notifications if the recipient can't see the comment.

Patch by [personal profile] exor674.

Files modified:
  • cgi-bin/LJ/Event/JournalNewComment/TopLevel.pm
--------------------------------------------------------------------------------
diff -r d0d5dd57615d -r 9d72c2a977cf cgi-bin/LJ/Event/JournalNewComment/TopLevel.pm
--- a/cgi-bin/LJ/Event/JournalNewComment/TopLevel.pm	Fri Jun 15 00:43:42 2012 +0000
+++ b/cgi-bin/LJ/Event/JournalNewComment/TopLevel.pm	Fri Jun 15 02:35:30 2012 +0000
@@ -29,11 +29,14 @@
     # check that subscription's journal is the same as event's journal
     return 0 if $sjid && $sjid != $ejid;
 
-
     my $comment = $self->comment;
     my $entry = $comment->entry;
     return 0 unless $entry;
 
+    # no notifications unless they can see the comment
+    my $watcher = $subscr->owner;
+    return 0 unless $comment->visible_to( $watcher );
+
     # check that event's entry is the entry we're interested in (subscribed to)
     my $wanted_ditemid = $subscr->arg1;
     return 0 if $wanted_ditemid && $entry->ditemid != $wanted_ditemid;
--------------------------------------------------------------------------------