madeon (madeon) wrote in changelog,
madeon
madeon
changelog

[livejournal] r22892: LJSUP-12654: Do not add reposted entry t...

Committer: sbelyaev
LJSUP-12654: Do not add reposted entry to RSS
U   trunk/cgi-bin/ljfeed.pl
Modified: trunk/cgi-bin/ljfeed.pl
===================================================================
--- trunk/cgi-bin/ljfeed.pl	2012-09-14 07:12:14 UTC (rev 22891)
+++ trunk/cgi-bin/ljfeed.pl	2012-09-14 07:35:13 UTC (rev 22892)
@@ -5,6 +5,7 @@
 no warnings 'uninitialized';
 
 use LJ::Entry;
+use LJ::Entry::Repost;
 use LJ::Request;
 use LJ::TimeUtil;
 use XML::Atom::Person;
@@ -114,6 +115,15 @@
             return undef;
         }
 
+        if (LJ::Entry::Repost->substitute_content($entry, 
+                                              { 'original_post_obj' => \$entry,} )) {
+            
+            if ( ! $entry || ! $entry->valid || ! $entry->visible_to($remote) ) {
+                $opts->{'handler_return'} = 404;
+                return undef;
+            }
+        }
+
         push @objs, $entry;
     }
     elsif ( $viewfunc->{'paid_only'} ) {
@@ -200,11 +210,18 @@
 
   ENTRY:
     foreach my $entry_obj (@objs) {
-        my $ditemid = $entry_obj->{ditemid};
-
         next ENTRY if $entry_obj->poster->{'statusvis'} eq 'S';
         next ENTRY if $entry_obj && $entry_obj->is_suspended_for($remote);
+    
+        my $reposted = LJ::Entry::Repost->substitute_content($entry_obj,
+                                                           { 'original_post_obj' => \$entry_obj,} );
 
+        if ($reposted) {
+            next ENTRY if $entry_obj->poster->{'statusvis'} eq 'S';
+            next ENTRY if $entry_obj && $entry_obj->is_suspended_for($remote);
+        }
+    
+        my $ditemid = $entry_obj->{ditemid};
         if ( $LJ::UNICODE && $entry_obj->prop('unknown8bit') ) {
             LJ::item_toutf8(
                 $u,

Tags: livejournal, madeon, pl, sbelyaev
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