From 064effe5fd861be2623c7bd1f8a6037e6d470c29 Mon Sep 17 00:00:00 2001 From: Mario Date: Fri, 22 Jan 2021 10:11:27 +0000 Subject: fix encode_item_collection() --- Zotlabs/Lib/Activity.php | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) (limited to 'Zotlabs') diff --git a/Zotlabs/Lib/Activity.php b/Zotlabs/Lib/Activity.php index d552a9b3c..197409a19 100644 --- a/Zotlabs/Lib/Activity.php +++ b/Zotlabs/Lib/Activity.php @@ -267,7 +267,7 @@ class Activity { static function encode_item_collection($items, $id, $type, $total = 0) { - if ($total > 100) { + if ($total > 30) { $ret = [ 'id' => z_root() . '/' . $id, 'type' => $type . 'Page', @@ -300,11 +300,17 @@ class Activity { $x = []; foreach ($items as $i) { $m = get_iconfig($i['id'], 'activitypub', 'rawmsg'); - if (is_string($m)) { - $t = json_decode($m, true); + if ($m) { + if (is_string($m)) + $t = json_decode($m,true); + else + $t = $m; } else { - $t = $m; + $t = self::encode_activity($i); + } + if ($t) { + $x[] = $t; } if ($t) { $x[] = $t; -- cgit v1.2.3