madeon (madeon) wrote in changelog,
madeon
madeon
changelog

[ljcom] r12131: LJSUP-12598: Correct link in social netw...

Committer: sbelyaev
LJSUP-12598: Correct link in social networks
U   trunk/bin/upgrading/en_LJ.dat
U   trunk/cgi-bin/LJ/Worker/Repost/EntryToFacebook.pm
U   trunk/cgi-bin/LJ/Worker/Repost/EntryToTwitter.pm
U   trunk/cgi-bin/LJ/Worker/Repost/EntryToVkontakte.pm
Modified: trunk/bin/upgrading/en_LJ.dat
===================================================================
--- trunk/bin/upgrading/en_LJ.dat	2012-06-19 08:08:56 UTC (rev 12130)
+++ trunk/bin/upgrading/en_LJ.dat	2012-06-19 10:47:33 UTC (rev 12131)
@@ -2722,6 +2722,8 @@
 
 facebookconnect.notification.title2=posted a new entry to '[[journal]]' at LiveJournal.
 
+facebookconnect.notification.repost.title=reposted an entry from '[[journal]]' to '[[journal_real]]' at LiveJournal.
+
 facebookconnect.question|staleness=1
 facebookconnect.question=What do you think?
 

Modified: trunk/cgi-bin/LJ/Worker/Repost/EntryToFacebook.pm
===================================================================
--- trunk/cgi-bin/LJ/Worker/Repost/EntryToFacebook.pm	2012-06-19 08:08:56 UTC (rev 12130)
+++ trunk/cgi-bin/LJ/Worker/Repost/EntryToFacebook.pm	2012-06-19 10:47:33 UTC (rev 12131)
@@ -31,17 +31,37 @@
         'access_token' => $poster->prop('facebook_access_token'),
         'link' => $entry->url,
     };
+    
+    
+    if ($entry->original_post) {
+        my $real_entry = $entry;
+        $entry = $entry->original_post;
+        return $job->completed unless $entry->visible_to;
 
-    $data->{'message'} = LJ::Lang::get_text(
-        $poster->prop('browselang'),
-        'facebookconnect.notification.title2',
-        undef,
-        {
-            'journal' => $journal->display_name,
-            'url' => $entry->url,
-        },
-    );
+        $data->{'link'} = $entry->url;
+        $data->{'message'} = LJ::Lang::get_text(
+            $poster->prop('browselang'),
+            'facebookconnect.notification.repost.title',
+            undef,
+                {'journal_real' => $journal->display_name,
+                 'journal' => $entry->journal->display_name,
+                 'url' => $entry->url,
+            },
+        );
 
+    
+    } else {
+        $data->{'message'} = LJ::Lang::get_text(
+            $poster->prop('browselang'),
+            'facebookconnect.notification.title2',
+            undef,
+                {
+                'journal' => $journal->display_name,
+                'url' => $entry->url,
+            },
+        );
+    }
+
     my $event_raw = $entry->event_raw;
 
     my $picture = $arg->{'thumbnail'}

Modified: trunk/cgi-bin/LJ/Worker/Repost/EntryToTwitter.pm
===================================================================
--- trunk/cgi-bin/LJ/Worker/Repost/EntryToTwitter.pm	2012-06-19 08:08:56 UTC (rev 12130)
+++ trunk/cgi-bin/LJ/Worker/Repost/EntryToTwitter.pm	2012-06-19 10:47:33 UTC (rev 12131)
@@ -24,6 +24,9 @@
     # is fine and don't even attempt to repost
     return $job->completed unless $entry->valid;
 
+    $entry = $entry->original_post ? $entry->original_post : $entry;
+    return $job->completed unless $entry->visible_to;
+
     my $short_url = $class->shorten_url($entry->url);
     my $title     = $entry->subject_raw || $entry->event_raw;
 

Modified: trunk/cgi-bin/LJ/Worker/Repost/EntryToVkontakte.pm
===================================================================
--- trunk/cgi-bin/LJ/Worker/Repost/EntryToVkontakte.pm	2012-06-19 08:08:56 UTC (rev 12130)
+++ trunk/cgi-bin/LJ/Worker/Repost/EntryToVkontakte.pm	2012-06-19 10:47:33 UTC (rev 12131)
@@ -18,6 +18,9 @@
     # is fine and don't even attempt to repost
     return $job->completed unless $entry->valid;
 
+    $entry = $entry->original_post ? $entry->original_post : $entry;
+    return $job->completed unless $entry->visible_to;
+
     my $url   = $entry->url;
     my $title = $entry->subject_raw || $entry->event_raw;
 

Tags: dat, ljcom, 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