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

[livejournal] r19670: LJSUP-9305: Identity attributes added fo...

Committer: vtroitsky
LJSUP-9305: Identity attributes added for users in getevents/getfriendspage XML-RPC functions
U   trunk/cgi-bin/ljprotocol.pl
Modified: trunk/cgi-bin/ljprotocol.pl
===================================================================
--- trunk/cgi-bin/ljprotocol.pl	2011-08-09 12:18:06 UTC (rev 19669)
+++ trunk/cgi-bin/ljprotocol.pl	2011-08-09 12:58:11 UTC (rev 19670)
@@ -614,6 +614,7 @@
             my $i = $item->{upost}->identity;
             $item_data->{'identity_type'} = $i->pretty_type;
             $item_data->{'identity_value'} = $i->value;
+            $item_data->{'identity_url'} = $i->url;
             $item_data->{'identity_display'} = $item->{upost}->display_name;
         }
 
@@ -1023,6 +1024,13 @@
         $_->{postertype} = $users->{ $_->{posterid} }->{'journaltype'};
         $_->{posterurl}  = $users->{ $_->{posterid} }->journal_base;
         delete $_->{posterid};
+        if ($users->{ $_->{posterid} }->identity) {
+                my $i = $users->{ $_->{posterid} }->identity;
+                $_->{'identity_type'} = $i->pretty_type;
+                $_->{'identity_value'} = $i->value;
+                $_->{'identity_url'} = $i->url;
+                $_->{'identity_display'} = $users->{ $_->{posterid} }->display_name;
+        }
     }
 
     LJ::run_hooks("getfriendspage", {userid => $u->userid, });
@@ -3192,7 +3200,17 @@
             $evt->{'allowmask'} = $mask if $sec eq "usemask";
         }
         $evt->{'anum'} = $anum;
-        $evt->{'poster'} = LJ::get_username($dbr, $jposterid) if $jposterid != $ownerid;
+        if ($jposterid != $ownerid) {
+            my $uposter = LJ::load_userid($jposterid);
+            $evt->{'poster'} = $uposter->username;
+            if ($uposter->identity) {
+                my $i = $uposter->identity;
+                $evt->{'identity_type'} = $i->pretty_type;
+                $evt->{'identity_value'} = $i->value;
+                $evt->{'identity_url'} = $i->url;
+                $evt->{'identity_display'} = $uposter->display_name;
+            }
+        }
         $evt->{'url'} = LJ::item_link($uowner, $itemid, $anum);
         $evt->{'reply_count'} = $replycount;
         push @$events, $evt;
@@ -3481,6 +3499,7 @@
                 my $i = $row->identity;
                 $added->{'identity_type'} = $i->pretty_type;
                 $added->{'identity_value'} = $i->value;
+                $added->{'identity_url'} = $i->url;
                 $added->{'identity_display'} = $row->display_name;
             }
             $added->{"type"} = {
@@ -3841,7 +3860,8 @@
             my $i = $u->identity;
             $r->{'identity_type'} = $i->pretty_type;
             $r->{'identity_value'} = $i->value;
-            $r->{'identity_display'} = $u->display_name;
+            $r->{'identity_url'} = $i->url;
+           $r->{'identity_display'} = $u->display_name;
         }
 
         if ($opts->{'includebdays'} &&

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