From b878b6902817c7f442281cef30d346bd2a60659f Mon Sep 17 00:00:00 2001 From: Mario Date: Wed, 30 Sep 2020 10:10:49 +0000 Subject: 5.0RC testing: fix issue in relation with deletes --- Zotlabs/Lib/Activity.php | 21 ++++++++++++++++++--- 1 file changed, 18 insertions(+), 3 deletions(-) (limited to 'Zotlabs/Lib/Activity.php') diff --git a/Zotlabs/Lib/Activity.php b/Zotlabs/Lib/Activity.php index 7de2ca7ec..7ad6c91ae 100644 --- a/Zotlabs/Lib/Activity.php +++ b/Zotlabs/Lib/Activity.php @@ -652,13 +652,28 @@ class Activity { else return []; - $ret['object'] = str_replace('/item/','/activity/',$i['mid']); + if ($i['obj']) { + if (! is_array($i['obj'])) { + $i['obj'] = json_decode($i['obj'],true); + } + $obj = self::encode_object($i['obj']); + if ($obj) + $ret['object'] = $obj; + else + return []; + } + else { + $obj = self::encode_item($i,$activitypub); + if ($obj) + $ret['object'] = $obj; + else + return []; + } + $ret['to'] = [ ACTIVITY_PUBLIC_INBOX ]; return $ret; - } - $ret['type'] = self::activity_mapper($i['verb']); if($ret['type'] === 'emojiReaction') { -- cgit v1.2.3