aboutsummaryrefslogtreecommitdiffstats
path: root/include/conversation.php
diff options
context:
space:
mode:
Diffstat (limited to 'include/conversation.php')
-rw-r--r--include/conversation.php15
1 files changed, 12 insertions, 3 deletions
diff --git a/include/conversation.php b/include/conversation.php
index c02b0c4c8..f8d5f7ec0 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');
@@ -1297,11 +1306,11 @@ function format_like($cnt, $arr, $type, $id) {
/**
* Wrapper to allow addons to replace the status editor if desired.
*/
-function status_editor($a, $x, $popup = false, $module='') {
+function status_editor($x, $popup = false, $module='') {
$hook_info = ['editor_html' => '', 'x' => $x, 'popup' => $popup, 'module' => $module];
call_hooks('status_editor',$hook_info);
if ($hook_info['editor_html'] == '') {
- return hz_status_editor($a, $x, $popup);
+ return hz_status_editor($x, $popup);
} else {
return $hook_info['editor_html'];
}
@@ -1313,7 +1322,7 @@ function status_editor($a, $x, $popup = false, $module='') {
* They are referring to the content editor or components thereof.
*/
-function hz_status_editor($a, $x, $popup = false) {
+function hz_status_editor($x, $popup = false) {
$o = '';