diff options
author | Mario <mario@mariovavti.com> | 2020-08-20 08:43:13 +0000 |
---|---|---|
committer | Mario <mario@mariovavti.com> | 2020-08-20 08:43:13 +0000 |
commit | e55a1a6aa8fe55d20b588f0223a15018053bfd48 (patch) | |
tree | 0ef7ab566e09430d61d95013af48e862a0023858 /Zotlabs/Lib/Activity.php | |
parent | 21e5b05b149736bcc49a662d713be5deadb32c16 (diff) | |
download | volse-hubzilla-e55a1a6aa8fe55d20b588f0223a15018053bfd48.tar.gz volse-hubzilla-e55a1a6aa8fe55d20b588f0223a15018053bfd48.tar.bz2 volse-hubzilla-e55a1a6aa8fe55d20b588f0223a15018053bfd48.zip |
fix item deletion
Diffstat (limited to 'Zotlabs/Lib/Activity.php')
-rw-r--r-- | Zotlabs/Lib/Activity.php | 38 |
1 files changed, 25 insertions, 13 deletions
diff --git a/Zotlabs/Lib/Activity.php b/Zotlabs/Lib/Activity.php index 25f19510d..83c04c042 100644 --- a/Zotlabs/Lib/Activity.php +++ b/Zotlabs/Lib/Activity.php @@ -314,14 +314,6 @@ class Activity { else { $objtype = self::activity_obj_mapper($i['obj_type']); } - - if(intval($i['item_deleted'])) { - $ret['type'] = 'Tombstone'; - $ret['formerType'] = $objtype; - $ret['id'] = ((strpos($i['mid'],'http') === 0) ? $i['mid'] : z_root() . '/item/' . urlencode($i['mid'])); - return $ret; - } - if ($i['obj']) { $ret = Activity::encode_object($i['obj']); @@ -651,16 +643,36 @@ class Activity { $ret['obj'] = []; } - if(intval($i['item_deleted'])) { - $ret['type'] = 'Tombstone'; - $ret['formerType'] = self::activity_obj_mapper($i['obj_type']); - $ret['id'] = ((strpos($i['mid'],'http') === 0) ? $i['mid'] : z_root() . '/item/' . urlencode($i['mid'])); + if (intval($i['item_deleted'])) { + $ret['type'] = 'Delete'; + $ret['id'] = str_replace('/item/','/activity/',$i['mid']) . '#delete'; $actor = self::encode_person($i['author'],false); - if($actor) + if ($actor) $ret['actor'] = $actor; else return []; + + 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); + if ($obj) + $ret['object'] = $obj; + else + return []; + } + + $ret['to'] = [ ACTIVITY_PUBLIC_INBOX ]; return $ret; + } |