madeon (madeon) wrote in changelog,
madeon
madeon
changelog

[livejournal] r22310: LJSUP-12636: Add line under repost title...

Committer: sbelyaev
LJSUP-12636: Add line under repost title
U   trunk/cgi-bin/LJ/Entry/Repost.pm
U   trunk/cgi-bin/LJ/S2/FriendsPage.pm
Modified: trunk/cgi-bin/LJ/Entry/Repost.pm
===================================================================
--- trunk/cgi-bin/LJ/Entry/Repost.pm	2012-06-22 11:54:50 UTC (rev 22309)
+++ trunk/cgi-bin/LJ/Entry/Repost.pm	2012-06-22 12:57:07 UTC (rev 22310)
@@ -438,6 +438,7 @@
 sub substitute_content {
     my ($class, $entry_obj, $opts) = @_;
 
+    my $remote = LJ::get_remote();
     my $original_entry_obj = $entry_obj->original_post;
 
     unless ($original_entry_obj) {
@@ -540,15 +541,50 @@
     }
 
     if ($opts->{'event_raw'}) {
-        ${$opts->{'event_raw'}} = $original_entry_obj->event_raw;
+        my $text_var =  LJ::u_equals($remote, $entry_obj->poster) ? 'entry.reference.journal.owner' :
+                                                                    'entry.reference.journal.guest';
+
+        my $event_text = $original_entry_obj->event_raw;
+        my $event =  LJ::Lang::ml($text_var,
+                                    { 'author'       => LJ::ljuser2($original_entry_obj->poster),
+                                      'reposter'     => LJ::ljuser2($entry_obj->poster),
+                                      'datetime'     => $entry_obj->eventtime_mysql,
+                                      'text'         => $event_text, });
+
+        ${$opts->{'event_raw'}} = $event;
     }
 
     if ($opts->{'event'}) {
-        ${$opts->{'event'}} = $original_entry_obj->event_html;
+        my $text_var =  LJ::u_equals($remote, $entry_obj->poster) ? 'entry.reference.journal.owner' : 
+                                                                    'entry.reference.journal.guest';
+
+        my $event_text = $original_entry_obj->event_raw;
+        my $event =  LJ::Lang::ml($text_var,  
+                                    { 'author'       => LJ::ljuser2($original_entry_obj->poster),
+                                      'reposter'     => LJ::ljuser2($entry_obj->poster),
+                                      'datetime'     => $entry_obj->eventtime_mysql,
+                                      'text'         => $event_text, });
+
+        ${$opts->{'event'}} = $event;
     }
 
-    if ($opts->{'event_friend'}) {       
-        ${$opts->{'event_friend'}} = $original_entry_obj->event_html;
+    if ($opts->{'event_friend'}) {
+        my $event_text = $original_entry_obj->event_raw;
+        my $journal = $original_entry_obj->journal;
+        
+        my $text_var = $journal->is_community ? 'entry.reference.friends.community' :
+                                                'entry.reference.friends.journal';
+
+        $text_var .= LJ::u_equals($remote, $entry_obj->poster) ? '.owner' : '.guest';
+
+        my $event = LJ::Lang::ml($text_var, 
+                                   { 'author'           => LJ::ljuser2($original_entry_obj->poster),
+                                     'communityname'    => LJ::ljuser2($original_entry_obj->journal),
+                                     'reposter'         => LJ::ljuser2($entry_obj->poster),
+                                     'datetime'         => $entry_obj->eventtime_mysql,
+                                     'text'             => $event_text, });
+
+        ${$opts->{'event_friend'}} = $event;
     }
 
     if ($opts->{'subject_repost'}) {

Modified: trunk/cgi-bin/LJ/S2/FriendsPage.pm
===================================================================
--- trunk/cgi-bin/LJ/S2/FriendsPage.pm	2012-06-22 11:54:50 UTC (rev 22309)
+++ trunk/cgi-bin/LJ/S2/FriendsPage.pm	2012-06-22 12:57:07 UTC (rev 22310)
@@ -278,7 +278,7 @@
                          'posterid'          => \$posterid,
                          'security'          => \$security,
                          'allowmask'         => \$allowmask,
-                         'event_raw'         => \$text,
+                         'event_friend'      => \$text,
                          'subject'           => \$subject,
                          'removed'           => \$removed,
                          'reply_count'       => \$replycount, };

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