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

[livejournal] r22354: LJSUP-11971: XML RPC getinbox: identity ...

Committer: nnikulochkina
LJSUP-11971: XML RPC getinbox: identity account support
U   trunk/cgi-bin/LJ/Event/JournalNewComment.pm
U   trunk/cgi-bin/LJ/Event/UserMessageRecvd.pm
Modified: trunk/cgi-bin/LJ/Event/JournalNewComment.pm
===================================================================
--- trunk/cgi-bin/LJ/Event/JournalNewComment.pm	2012-06-29 12:19:37 UTC (rev 22353)
+++ trunk/cgi-bin/LJ/Event/JournalNewComment.pm	2012-06-29 13:31:16 UTC (rev 22354)
@@ -685,7 +685,16 @@
 
     $res->{entry}   = $entry->url;
     $res->{comment} = $comment->url;
-    $res->{poster}  = $comment->poster->user if $comment->poster;
+    if (my $poster = $comment->poster) {
+        $res->{poster}  = $poster->user;
+        if($poster->is_identity){
+            my $i = $poster->identity;
+            $res->{'poster_identity_type'}    = $i->pretty_type;
+            $res->{'poster_identity_value'}   = $i->value;
+            $res->{'poster_identity_url'}     = $i->url($poster);
+            $res->{'poster_identity_display'} = $poster->display_name;
+        }
+    }
     $res->{subject} = $comment->subject_text;
 
     if ($extended){

Modified: trunk/cgi-bin/LJ/Event/UserMessageRecvd.pm
===================================================================
--- trunk/cgi-bin/LJ/Event/UserMessageRecvd.pm	2012-06-29 12:19:37 UTC (rev 22353)
+++ trunk/cgi-bin/LJ/Event/UserMessageRecvd.pm	2012-06-29 13:31:16 UTC (rev 22354)
@@ -304,6 +304,15 @@
         $pic = $msg->other_u->userpic;
     }
 
+    my $poster = $msg->other_u;
+    if($poster->is_identity){
+        my $i = $poster->identity;
+        $res->{'poster_identity_type'}    = $i->pretty_type;
+        $res->{'poster_identity_value'}   = $i->value;
+        $res->{'poster_identity_url'}     = $i->url($poster);
+        $res->{'poster_identity_display'} = $msg->other_u->display_name;
+    }
+
     $res->{from} = $msg->other_u->user;
     $res->{from_id} = $msg->other_u->{userid};
     $res->{picture} = $pic->url if $pic;

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