aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMario Vavti <mario@mariovavti.com>2022-08-07 12:17:56 +0200
committerMario Vavti <mario@mariovavti.com>2022-08-07 12:17:56 +0200
commit34858fce1cde40fd30e02a96e212e1ef2dc28e32 (patch)
tree7c735c90d8b9b80ba6bd0d2369d44bd453521771
parent3abc9ee387a58e07a84fc00085dea44d42816127 (diff)
parentb47dab0ee95bc6e2dc0cbe911f36e61137474b14 (diff)
downloadvolse-hubzilla-34858fce1cde40fd30e02a96e212e1ef2dc28e32.tar.gz
volse-hubzilla-34858fce1cde40fd30e02a96e212e1ef2dc28e32.tar.bz2
volse-hubzilla-34858fce1cde40fd30e02a96e212e1ef2dc28e32.zip
Merge branch 'dev'
-rw-r--r--Zotlabs/Lib/Activity.php18
-rw-r--r--Zotlabs/Widget/Channel_activities.php2
-rw-r--r--include/conversation.php11
3 files changed, 20 insertions, 11 deletions
diff --git a/Zotlabs/Lib/Activity.php b/Zotlabs/Lib/Activity.php
index 8e24dde41..7840e9999 100644
--- a/Zotlabs/Lib/Activity.php
+++ b/Zotlabs/Lib/Activity.php
@@ -2417,7 +2417,7 @@ class Activity {
$s['app'] = escape_tags($generator['name']);
}
- if (!$response_activity) {
+ if (is_array($act->obj) && !$response_activity) {
$a = self::decode_taxonomy($act->obj);
if ($a) {
$s['term'] = $a;
@@ -2429,16 +2429,16 @@ class Activity {
}
}
}
- }
- $a = self::decode_attachment($act->obj);
- if ($a) {
- $s['attach'] = $a;
- }
+ $a = self::decode_attachment($act->obj);
+ if ($a) {
+ $s['attach'] = $a;
+ }
- $a = self::decode_iconfig($act->obj);
- if ($a) {
- $s['iconfig'] = $a;
+ $a = self::decode_iconfig($act->obj);
+ if ($a) {
+ $s['iconfig'] = $a;
+ }
}
if (array_key_exists('type', $act->obj)) {
diff --git a/Zotlabs/Widget/Channel_activities.php b/Zotlabs/Widget/Channel_activities.php
index d12d80a8c..ab1db09ba 100644
--- a/Zotlabs/Widget/Channel_activities.php
+++ b/Zotlabs/Widget/Channel_activities.php
@@ -2,7 +2,7 @@
/**
* * Name: Channel Activity
- * * Description: A widget that shows you a greeting and info about your last login and other channel activities
+ * * Description: A widget that provides an overview of channels that require your attention and quick links to content that you have recently created or edited
*/
namespace Zotlabs\Widget;
diff --git a/include/conversation.php b/include/conversation.php
index d509342d4..685e6b15b 100644
--- a/include/conversation.php
+++ b/include/conversation.php
@@ -1,6 +1,7 @@
<?php /** @file */
use Zotlabs\Lib\Apps;
+use Zotlabs\Lib\Activity;
require_once('include/items.php');
@@ -90,7 +91,6 @@ function item_redir_and_replace_images($body, $images, $cid) {
function localize_item(&$item){
if (activity_match($item['verb'],ACTIVITY_LIKE) || activity_match($item['verb'],ACTIVITY_DISLIKE)){
-
if(! $item['obj'])
return;
@@ -106,6 +106,8 @@ function localize_item(&$item){
$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']);
+ elseif (is_string($obj['actor']))
+ $author_link = $obj['actor'];
else
$author_link = '';
@@ -114,6 +116,13 @@ function localize_item(&$item){
if(!$author_name)
$author_name = ((is_array($obj['actor']) && $obj['actor']['name']) ? $obj['actor']['name'] : '');
+ if(!$author_name && is_string($obj['actor'])) {
+ $cached_actor = Activity::get_cached_actor($obj['actor']);
+ if (is_array($cached_actor)) {
+ $author_name = (($cached_actor['name']) ? $cached_actor['name'] : $cached_actor['preferredUsername']);
+ }
+ }
+
if(is_array($obj['link']))
$item_url = get_rel_link($obj['link'],'alternate');