madeon (madeon) wrote in changelog,
madeon
madeon
changelog

[livejournal] r22131: LJSUP-11909: Fast Repost feature

Committer: sbelyaev
LJSUP-11909: Fast Repost feature
U   trunk/cgi-bin/LJ/Widget/EntryChooser.pm
Modified: trunk/cgi-bin/LJ/Widget/EntryChooser.pm
===================================================================
--- trunk/cgi-bin/LJ/Widget/EntryChooser.pm	2012-05-31 11:28:50 UTC (rev 22130)
+++ trunk/cgi-bin/LJ/Widget/EntryChooser.pm	2012-05-31 11:39:25 UTC (rev 22131)
@@ -29,6 +29,10 @@
                          'repost_obj'        => \$repost_entry_obj, };
 
         my $entry_reposted = LJ::Entry::Repost->substitute_content( $entry, $content );
+        if ($entry_reposted && !$entry->visible_to($remote)) {
+            $entry = $repost_entry_obj,
+            $repost_entry_obj = undef;
+        }
 
         my $entry_id = $entry->is_delayed ? $entry->delayedid : $entry->ditemid;
         my $entry_can_edit = 
@@ -36,6 +40,8 @@
             ! $entry->journal->is_readonly &&
             ! $entry->poster->is_readonly;
 
+        $entry_can_edit = 0 if $entry_reposted && !$repost_entry_obj;
+
         my $poster_ljuser = $opts->{'show_posters'}
             ? $entry->poster->ljuser_display
             : '';
@@ -78,7 +84,8 @@
         if ($entry->is_delayed) {
             $alldateparts = $entry->alldatepart;
         } else {
-            $alldateparts = LJ::TimeUtil->alldatepart_s2($entry->{'eventtime'});
+            my $eventtime = $repost_entry_obj ? $repost_entry_obj->{'eventtime'} : $entry->{'eventtime'};
+            $alldateparts = LJ::TimeUtil->alldatepart_s2($eventtime);
         }
 
         my ($year, $mon, $mday, $hour, $min) = split(/\D/, $alldateparts);

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