diff options
Diffstat (limited to 'include/conversation.php')
-rw-r--r-- | include/conversation.php | 20 |
1 files changed, 16 insertions, 4 deletions
diff --git a/include/conversation.php b/include/conversation.php index b43a6f47e..e77404cff 100644 --- a/include/conversation.php +++ b/include/conversation.php @@ -102,22 +102,33 @@ function localize_item(&$item){ logger('localize_item: failed to decode object: ' . print_r($item['obj'],true)); } - if($obj['author'] && $obj['author']['link']) + if(is_array($obj['author']) && $obj['author']['link']) $author_link = get_rel_link($obj['author']['link'],'alternate'); + elseif(is_array($obj['actor']) && $obj['actor']['url']) + $author_link = ((is_array($obj['actor']['url'])) ? $obj['actor']['url'][0]['href'] : $obj['actor']['url']); else $author_link = ''; $author_name = (($obj['author'] && $obj['author']['name']) ? $obj['author']['name'] : ''); - $item_url = get_rel_link($obj['link'],'alternate'); + if(!$author_name) + $author_name = ((is_array($obj['actor']) && $obj['actor']['name']) ? $obj['actor']['name'] : ''); + + if(is_array($obj['link'])) + $item_url = get_rel_link($obj['link'],'alternate'); + + if(!$item_url) + $item_url = $obj['id']; $Bphoto = ''; switch($obj['type']) { case ACTIVITY_OBJ_PHOTO: + case 'Photo': $post_type = t('photo'); break; case ACTIVITY_OBJ_EVENT: + case 'Event': $post_type = t('event'); break; case ACTIVITY_OBJ_PERSON: @@ -142,9 +153,10 @@ function localize_item(&$item){ break; case ACTIVITY_OBJ_NOTE: + case 'Note': default: - $post_type = t('status'); - if($obj['id'] != $obj['parent']) + $post_type = t('post'); + if(($obj['parent'] && $obj['id'] != $obj['parent']) || $obj['inReplyTo']) $post_type = t('comment'); break; } |