Андрей (andy) wrote in changelog,
Андрей
andy
changelog

[livejournal] r16146: LJSV-878 (ESN refactoring, part 1): use ...

Committer: ailyin
LJSV-878 (ESN refactoring, part 1): use correct check for
opt_gettalkemail

U   trunk/cgi-bin/LJ/Event/JournalNewComment.pm
Modified: trunk/cgi-bin/LJ/Event/JournalNewComment.pm
===================================================================
--- trunk/cgi-bin/LJ/Event/JournalNewComment.pm	2010-01-27 08:53:14 UTC (rev 16145)
+++ trunk/cgi-bin/LJ/Event/JournalNewComment.pm	2010-01-27 09:29:35 UTC (rev 16146)
@@ -680,7 +680,7 @@
 
     my @subs;
 
-    my $email_ntypeid =  LJ::NotificationMethod::Email->ntypeid;
+    my $email_ntypeid = LJ::NotificationMethod::Email->ntypeid;
 
     # own comments are deliberately sent to email only
     if ($comment_author->prop('opt_getselfemail') && $acquire_sub_slot->()) {
@@ -704,7 +704,7 @@
             'etypeid' => LJ::Event::CommentReply->etypeid,
             'userid'  => $parent_comment_author->id,
             'ntypeid' => $email_ntypeid,
-        }) if $parent_comment_author->{'opt_gettalkemail'};
+        }) if $parent_comment_author->{'opt_gettalkemail'} eq 'Y';
 
         if (my $count = $acquire_sub_slot->(scalar(@subs2))) {
             $#subs2 = $count - 1;
@@ -716,21 +716,25 @@
         !LJ::u_equals($comment_author, $entry_author) &&
         !$entry->prop('opt_noemail')
     ) {
-        my @subs2 = LJ::Subscription->find($entry_author,
-            'event' => 'CommunityEntryReply',
-            'require_active' => 1,
-        );
+        if (!LJ::u_equals($entry_author, $entry_journal)) {
+            # community journal
+            my @subs2 = LJ::Subscription->find($entry_author,
+                'event' => 'CommunityEntryReply',
+                'require_active' => 1,
+            );
 
-        push @subs2, LJ::Subscription->new_from_row({
-            'etypeid' => LJ::Event::CommunityEntryReply->etypeid,
+            if (my $count = $acquire_sub_slot->(scalar(@subs2))) {
+                $#subs2 = $count - 1;
+                push @subs, @subs2;
+            }
+        }
+
+        push @subs, LJ::Subscription->new_from_row({
+            'etypeid' => LJ::Event::JournalNewComment->etypeid,
             'userid'  => $entry_author->id,
             'ntypeid' => $email_ntypeid,
-        }) if $entry_author->{'opt_gettalkemail'};
-
-        if (my $count = $acquire_sub_slot->(scalar(@subs2))) {
-            $#subs2 = $count - 1;
-            push @subs, @subs2;
-        }
+        }) if
+            $entry_author->{'opt_gettalkemail'} eq 'Y' && $acquire_sub_slot->();
     }
 
     return @subs unless ($limit || !$original_limit);

Tags: andy, livejournal, pm
Subscribe

  • Post a new comment

    Error

    Anonymous comments are disabled in this journal

    default userpic

    Your reply will be screened

    Your IP address will be recorded 

  • 0 comments