aboutsummaryrefslogtreecommitdiffstats
path: root/include/conversation.php
diff options
context:
space:
mode:
Diffstat (limited to 'include/conversation.php')
-rw-r--r--include/conversation.php9
1 files changed, 9 insertions, 0 deletions
diff --git a/include/conversation.php b/include/conversation.php
index c02b0c4c8..5e63c4199 100644
--- a/include/conversation.php
+++ b/include/conversation.php
@@ -108,6 +108,8 @@ function localize_item(&$item){
$author_link = ((is_array($obj['actor']['url'])) ? $obj['actor']['url'][0]['href'] : $obj['actor']['url']);
elseif (isset($obj['actor']) && is_string($obj['actor']))
$author_link = $obj['actor'];
+ elseif (isset($obj['attributedTo']) && is_string($obj['attributedTo']) && $obj['attributedTo'])
+ $author_link = $obj['attributedTo'];
else
$author_link = '';
@@ -123,6 +125,13 @@ function localize_item(&$item){
}
}
+ if(!$author_name && isset($obj['attributedTo']) && is_string($obj['attributedTo'])) {
+ $cached_actor = Activity::get_cached_actor($obj['attributedTo']);
+ if (is_array($cached_actor)) {
+ $author_name = $cached_actor['name'] ?? $cached_actor['preferredUsername'];
+ }
+ }
+
$item_url = '';
if(isset($obj['link']) && is_array($obj['link']))
$item_url = get_rel_link($obj['link'],'alternate');