Friendica adds some addictional fields:
+- author: a user object, it's the author of the item. In case of a reshare for legacy reasons the "user" field doesn't show the real author. This field always contains the real author of a post.
- owner: a user object, it's the owner of the item.
- private: boolean, true if the item is marked as private
- activities: map with activities related to the item. Every activity is a list of user objects.
[
{
// ...
+ 'friendica_author' : {
+ // user object
+ },
'friendica_owner' : {
// user object
},
{
$status_user = api_get_user($a, defaults($item, 'author-id', null));
+ $author_user = $status_user;
+
$status_user["protected"] = defaults($item, 'private', 0);
if (defaults($item, 'thr-parent', '') == defaults($item, 'uri', '')) {
$owner_user = api_get_user($a, defaults($item, 'owner-id', null));
} else {
- $owner_user = $status_user;
+ $owner_user = $author_user;
}
- return ([$status_user, $owner_user]);
+ return ([$status_user, $author_user, $owner_user]);
}
/**
foreach ((array)$r as $item) {
localize_item($item);
- list($status_user, $owner_user) = api_item_get_user($a, $item);
+ list($status_user, $author_user, $owner_user) = api_item_get_user($a, $item);
// Look if the posts are matching if they should be filtered by user id
if ($filter_user && ($status_user["id"] != $user_info["id"])) {
$geo => null,
'favorited' => $item['starred'] ? true : false,
'user' => $status_user,
+ 'friendica_author' => $author_user,
'friendica_owner' => $owner_user,
'friendica_private' => $item['private'] == 1,
//'entities' => NULL,
$retweeted_status['friendica_activities'] = api_format_items_activities($retweeted_item, $type);
$retweeted_status['created_at'] = api_date($retweeted_item['created']);
$status['retweeted_status'] = $retweeted_status;
+ $status['friendica_author'] = $retweeted_status['user'];
}
}