]> git.mxchange.org Git - quix0rs-gnu-social.git/blobdiff - lib/apiaction.php
Merge remote-tracking branch 'statusnet/180' into statusnet_1.1.x
[quix0rs-gnu-social.git] / lib / apiaction.php
index 980500abcc52e1f8b09605829d09286b76860e58..14e21ae4fdc15f8ad8980862bc473a57d8e16fd8 100644 (file)
@@ -215,7 +215,7 @@ class ApiAction extends Action
             Avatar::defaultImage(AVATAR_STREAM_SIZE);
 
         $twitter_user['url'] = ($profile->homepage) ? $profile->homepage : null;
-        $twitter_user['protected'] = ($user->private_stream) ? true : false;
+        $twitter_user['protected'] = (!empty($user) && $user->private_stream) ? true : false;
         $twitter_user['followers_count'] = $profile->subscriberCount();
 
         // Note: some profiles don't have an associated user
@@ -958,9 +958,9 @@ class ApiAction extends Action
         $to_profile = $message->getTo();
 
         $dmsg['id'] = intval($message->id);
-        $dmsg['sender_id'] = intval($from_profile);
+        $dmsg['sender_id'] = intval($from_profile->id);
         $dmsg['text'] = trim($message->content);
-        $dmsg['recipient_id'] = intval($to_profile);
+        $dmsg['recipient_id'] = intval($to_profile->id);
         $dmsg['created_at'] = $this->dateTwitter($message->created);
         $dmsg['sender_screen_name'] = $from_profile->nickname;
         $dmsg['recipient_screen_name'] = $to_profile->nickname;