sunnyman's (sunnyman) wrote in changelog,
sunnyman's
sunnyman
changelog

[livejournal] r19651: LJAPP-1150: XML-RPC function editfriends...

Committer: vtroitsky
LJAPP-1150: XML-RPC function editfriends returns detaliled info for users being added
U   trunk/cgi-bin/ljprotocol.pl
Modified: trunk/cgi-bin/ljprotocol.pl
===================================================================
--- trunk/cgi-bin/ljprotocol.pl	2011-08-09 04:43:49 UTC (rev 19650)
+++ trunk/cgi-bin/ljprotocol.pl	2011-08-09 06:21:37 UTC (rev 19651)
@@ -3466,16 +3466,31 @@
             $error_flag = 1;
         } else {
             $friends_added++;
-            my $added = { 'username' => $aname,
-                          'fullname' => $row->{'name'},
+            my $added = { 'username'    => $aname,
+                          'fullname'    => $row->{'name'},
                           'journaltype' => $row->{journaltype},
                           'defaultpicurl' => ($row->{'defaultpicid'} && "$LJ::USERPIC_ROOT/$row->{'defaultpicid'}/$row->{'userid'}"),
+                          'fgcolor'     => $fg,
+                          'bgcolor'     => $bg,
                       };
             if ($req->{'ver'} >= 1) {
                 LJ::text_out(\$added->{'fullname'});
             }
-            push @{$res->{'added'}}, $added;
 
+            if ($row->identity) {
+                my $i = $row->identity;
+                $added->{'identity_type'} = $i->pretty_type;
+                $added->{'identity_value'} = $i->value;
+                $added->{'identity_display'} = $row->display_name;
+            }
+            $added->{"type"} = {
+                'C' => 'community',
+                'Y' => 'syndicated',
+                'N' => 'news',
+                'S' => 'shared',
+                'I' => 'identity',
+            }->{$row->{'journaltype'}} if $row->{'journaltype'} ne 'P';
+
             my $qfg = LJ::color_todb($fg);
             my $qbg = LJ::color_todb($bg);
 
@@ -3493,6 +3508,9 @@
             # force bit 0 on.
             $gmask |= 1;
 
+            $added->{groupmask} = $gmask;
+            push @{$res->{'added'}}, $added;
+
             # TAG:FR:protocol:editfriends4_addeditfriend
             my $cnt = $dbh->do("REPLACE INTO friends (userid, friendid, fgcolor, bgcolor, groupmask) ".
                                "VALUES ($userid, $friendid, $qfg, $qbg, $gmask)");

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