журнал (shhh) wrote in changelog,
журнал
shhh
changelog

[livejournal] r22593: LJSUP-13108: Paid repost button

Committer: nnikulochkina
LJSUP-13108: Paid repost button
U   trunk/cgi-bin/LJ/Entry/Repost.pm
Modified: trunk/cgi-bin/LJ/Entry/Repost.pm
===================================================================
--- trunk/cgi-bin/LJ/Entry/Repost.pm	2012-08-08 06:26:10 UTC (rev 22592)
+++ trunk/cgi-bin/LJ/Entry/Repost.pm	2012-08-08 06:53:42 UTC (rev 22593)
@@ -626,14 +626,15 @@
     my $journalid = $entry_obj->journalid;
     my $jitemid   = $entry_obj->jitemid;
 
+    my $error;
 
     my $memcache_key = join ':', 'reposted_item', $entry_obj->journalid, $entry_obj->jitemid, $u->id;
     if (LJ::MemCache::get($memcache_key)) {
-        return LJ::API::Error->get_error('repost_already_exist');
+        $error = LJ::API::Error->get_error('repost_already_exist');
+        $error->{'error'}->{'data'} = $class->get_status($entry_obj, $u);
+        return $error;
     }
 
-    my $error;
-
     my $reposted_obj = __create_repost( {'u'          => $u,
                                          'entry_obj'  => $entry_obj,
                                          'timezone'   => $timezone,
@@ -648,10 +649,14 @@
         
         return $result;
         
-    } elsif ($error && $error->{'error'}) {
-         return $error;
     } else {
-        return LJ::API::Error->get_error('unknown_error');
+        unless ($error && $error->{'error'}) {
+            $error = LJ::API::Error->get_error('unknown_error');
+        }
+
+        $error->{'error'}->{'data'} = $class->get_status($entry_obj, $u);
+
+        return $error;
     } 
 }
 

Tags: livejournal, nikulochkina, nnikulochkina, pm
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