From 96412544434fdcf06971afdccb19e9e8dd3ea607 Mon Sep 17 00:00:00 2001 From: zotlabs Date: Sun, 28 Apr 2019 18:20:40 -0700 Subject: event attachments still weren't being delivered to zot6 --- Zotlabs/Lib/Activity.php | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) (limited to 'Zotlabs/Lib') diff --git a/Zotlabs/Lib/Activity.php b/Zotlabs/Lib/Activity.php index 5c3002837..9df7db169 100644 --- a/Zotlabs/Lib/Activity.php +++ b/Zotlabs/Lib/Activity.php @@ -195,6 +195,13 @@ class Activity { if(! $ev['nofinish']) { $y['endTime'] = (($ev['adjust']) ? datetime_convert('UTC','UTC',$ev['dtend'], ATOM_TIME) : datetime_convert('UTC','UTC',$ev['dtend'],'Y-m-d\\TH:i:s-00:00')); } + + // copy attachments from the passed object - these are already formatted for ActivityStreams + + if($x['attachment']) { + $y['attachment'] = $x['attachment']; + } + if($actor) { return $y; } @@ -404,7 +411,7 @@ class Activity { $ret = []; if($item['attach']) { - $atts = json_decode($item['attach'],true); + $atts = ((is_array($item['attach'])) ? $item['attach'] : json_decode($item['attach'],true)); if($atts) { foreach($atts as $att) { if(strpos($att['type'],'image')) { @@ -416,7 +423,7 @@ class Activity { } } } - + return $ret; } -- cgit v1.2.3