fu: Close-up of Fu, bringing a scoop of water to her mouth (Default)
fu ([personal profile] fu) wrote in [site community profile] changelog2012-01-01 02:26 pm

[dw-free] Implement getreadpage in the API

[commit: http://hg.dwscoalition.org/dw-free/rev/865274c97527]

http://bugs.dwscoalition.org/show_bug.cgi?id=4117

Untangle bad copy-pasta.

Patch by [personal profile] fu.

Files modified:
  • cgi-bin/LJ/Protocol.pm
--------------------------------------------------------------------------------
diff -r d5c172bccac3 -r 865274c97527 cgi-bin/LJ/Protocol.pm
--- a/cgi-bin/LJ/Protocol.pm	Sun Jan 01 03:54:12 2012 +0000
+++ b/cgi-bin/LJ/Protocol.pm	Sun Jan 01 22:25:40 2012 +0800
@@ -3305,6 +3305,7 @@
     # get the request and response hash refs
     my ($req, $res, $flags) = @_;
 
+warn Data::Dumper::Dumper( "in do_request", $req );
     # initialize some stuff
     %{$res} = ();                      # clear the given response hash
     $flags = {} unless (ref $flags eq "HASH");
@@ -3394,7 +3395,7 @@
     if ($req->{'mode'} eq "getfriendspage") {
         return getfriendspage($req, $res, $flags);
     }
-    if ($req->{'mode'} eq "getfriendspage") {
+    if ($req->{'mode'} eq "getreadpage") {
         return getreadpage( $req, $res, $flags );
     }
 
@@ -3405,7 +3406,7 @@
 }
 
 ## flat wrapper
-sub getreadpage
+sub getfriendspage
 {
     my ($req, $res, $flags) = @_;
 
@@ -3419,20 +3420,6 @@
         return 0;
     }
 
-    my $ect = 0;
-    foreach my $evt (@{$rs->{'entries'}}) {
-        $ect++;
-        foreach my $f (qw(subject_raw journalname journaltype postername postertype ditemid security)) {
-            if (defined $evt->{$f}) {
-                $res->{"entries_${ect}_$f"} = $evt->{$f};
-            }
-        }
-        $res->{"entries_${ect}_event"} = LJ::eurl($evt->{'event_raw'});
-    }
-
-    $res->{'entries_count'} = $ect;
-    $res->{'success'} = "OK";
-
     return 1;
 }
 
--------------------------------------------------------------------------------