fu: Close-up of Fu, bringing a scoop of water to her mouth (Default)
fu ([personal profile] fu) wrote in [site community profile] changelog2011-04-01 07:31 am

[dw-free] "filter to this entry" should include comment edit notifications

[commit: http://hg.dwscoalition.org/dw-free/rev/7a87e8cad75d]

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

Look up the list of events which should be included, instead of hardcoding.

Patch by [personal profile] fu.

Files modified:
  • cgi-bin/LJ/NotificationInbox.pm
--------------------------------------------------------------------------------
diff -r 08ca14543825 -r 7a87e8cad75d cgi-bin/LJ/NotificationInbox.pm
--- a/cgi-bin/LJ/NotificationInbox.pm	Fri Apr 01 15:13:37 2011 +0800
+++ b/cgi-bin/LJ/NotificationInbox.pm	Fri Apr 01 15:30:58 2011 +0800
@@ -178,8 +178,9 @@ sub subset_items {
 
 sub singleentry_items {
     my ( $self, $itemid ) = @_;
+    my %related_events = map { $_ => 1 } LJ::Event::JournalNewComment->related_events;
     return grep {
-        ( $_->event->class eq "LJ::Event::JournalNewComment" || $_->event->class eq "LJ::Event::JournalNewComment::TopLevel" )
+        $related_events{$_->event->etypeid}
         && $_->event->comment
         && $_->event->comment->entry    # may have been deleted, which breaks all filter to entry comments
         && $_->event->comment->entry->ditemid == $itemid
--------------------------------------------------------------------------------
kareila: (Default)

[personal profile] kareila 2011-04-01 12:02 pm (UTC)(link)
Oh hey, that was easy :-)