madeon (madeon) wrote in changelog,
madeon
madeon
changelog

[livejournal] r22219: LJSUP-12534: not working Collapse repost...

Committer: sbelyaev
LJSUP-12534: not working Collapse reposts
U   trunk/cgi-bin/LJ/S2/FriendsPage.pm
U   trunk/cgi-bin/ljviews.pl
Modified: trunk/cgi-bin/LJ/S2/FriendsPage.pm
===================================================================
--- trunk/cgi-bin/LJ/S2/FriendsPage.pm	2012-06-09 09:05:22 UTC (rev 22218)
+++ trunk/cgi-bin/LJ/S2/FriendsPage.pm	2012-06-09 09:18:31 UTC (rev 22219)
@@ -150,6 +150,7 @@
     my %friends;
     my %friends_row;
     my %idsbycluster;
+    my %reposts;
 
     my @items = LJ::get_friend_items({
         'u'                 => $u,
@@ -253,7 +254,6 @@
             $text    =~ s{<(?!/?lj)(.*?)>} {&lt;$1&gt;}gi;
         }
 
-
         if ($LJ::UNICODE && $logprops{$datakey}->{'unknown8bit'}) {
             LJ::item_toutf8($friends{$friendid}, \$subject, \$text, $logprops{$datakey});
         }
@@ -289,6 +289,12 @@
             $friends{$friendid} = $friend;
             $datakey  = "repost $friendid $itemid";    
 
+            if (!$reposts{$datakey}) {
+                $reposts{$datakey} = 1;
+            } else {
+                $reposts{$datakey}++;
+            }
+
             if (!$logprops{$datakey}) {
                 $logprops{$datakey} = $entry_obj->props;
  
@@ -300,10 +306,11 @@
             }
         }
 
-        if ( $remote && 
-             $logprops{$datakey}->{'repost'} && 
-             $remote->prop('hidefriendsreposts') && 
-             ! $remote->prop('opt_ljcut_disable_friends') ) 
+        if ( ($remote && 
+              $logprops{$datakey}->{'repost'} && 
+              $remote->prop('hidefriendsreposts') && 
+              ! $remote->prop('opt_ljcut_disable_friends')) ||
+              $reposts{$datakey} > 1 ) 
         {
             $text = LJ::Lang::ml(
                 'friendsposts.reposted',

Modified: trunk/cgi-bin/ljviews.pl
===================================================================
--- trunk/cgi-bin/ljviews.pl	2012-06-09 09:05:22 UTC (rev 22218)
+++ trunk/cgi-bin/ljviews.pl	2012-06-09 09:18:31 UTC (rev 22219)
@@ -1617,6 +1617,7 @@
     my ($ret, $u, $vars, $remote, $opts) = @_;
     my $sth;
     my $user = $u->{'user'};
+    my %reposts;
 
     # Check if we should redirect due to a bad password
     $opts->{'redir'} = LJ::bad_password_redirect({ 'returl' => 1 });
@@ -1894,14 +1895,19 @@
                          'cluster_id'        => \$clusterid, };
 
         if (LJ::Entry::Repost->substitute_content( $entry_obj, $content )) {
-
             $friendid = $journalu->userid;
             $logprops{$itemid} = $entry_obj->props;
             $friends{$friendid} = $journalu;
             $pu = $entry_obj->poster;
 
-            $datakey = "$friendid $itemid";
+            $datakey = "repost $friendid $itemid";
 
+            if (!$reposts{$datakey}) {
+                $reposts{$datakey} = 1;
+            } else {
+                $reposts{$datakey}++;
+            }
+
             if (!$logprops{$datakey}) {
                 $logprops{$datakey} = $entry_obj->props;
 
@@ -1913,7 +1919,12 @@
             }
         }
 
-        if ( $logprops{$datakey}->{'repost'} && $remote && $remote->prop('hidefriendsreposts') && ! $remote->prop('opt_ljcut_disable_friends') ) {
+        if ( ($logprops{$datakey}->{'repost'} &&
+              $remote && 
+              $remote->prop('hidefriendsreposts') && \
+              ! $remote->prop('opt_ljcut_disable_friends')) ||
+              $reposts{$datakey} > 1 ) 
+        {
             $event = LJ::Lang::ml(
                 'friendsposts.reposted',
                 {

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