From 161050df074bffdacf9fc39f042d17dd84f63ee5 Mon Sep 17 00:00:00 2001 From: redmatrix Date: Wed, 17 Feb 2016 15:56:30 -0800 Subject: format atom event renderings so they are reasonably compatible with GNU-social --- include/items.php | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) (limited to 'include') diff --git a/include/items.php b/include/items.php index ab859bebd..ca4bbd7be 100755 --- a/include/items.php +++ b/include/items.php @@ -4007,12 +4007,25 @@ function atom_entry($item,$type,$author,$owner,$comment = false,$cid = 0) { $o .= '' . "\r\n"; } + if(activity_compare($item['obj_type'],ACTIVITY_OBJ_EVENT) && activity_compare($item['verb'],ACTIVITY_POST)) { + $obj = ((is_array($item['obj'])) ? $item['object'] : json_decode($item['object'],true)); + + $o .= '' . xmlify($item['title']) . '' . "\r\n"; + $o .= '' . xmlify(bbcode($obj['title'])) . '' . "\r\n"; + $o .= '' . datetime_convert('UTC','UTC', $obj['start'],'Ymd\\THis' . (($obj['adjust']) ? '\\Z' : '')) . '' . "\r\n"; + $o .= '' . datetime_convert('UTC','UTC', $obj['finish'],'Ymd\\THis' . (($obj['adjust']) ? '\\Z' : '')) . '' . "\r\n"; + $o .= '' . bbcode($obj['location']) . '' . "\r\n"; + $o .= '' . xmlify(bbcode($obj['description'])) . '' . "\r\n"; + } + else { + $o .= '' . xmlify($item['title']) . '' . "\r\n"; + $o .= '' . xmlify(prepare_text($body,$item['mimetype'])) . '' . "\r\n"; + } + $o .= '' . xmlify($item['mid']) . '' . "\r\n"; - $o .= '' . xmlify($item['title']) . '' . "\r\n"; $o .= '' . xmlify(datetime_convert('UTC','UTC',$item['created'] . '+00:00',ATOM_TIME)) . '' . "\r\n"; $o .= '' . xmlify(datetime_convert('UTC','UTC',$item['edited'] . '+00:00',ATOM_TIME)) . '' . "\r\n"; - $o .= '' . xmlify(prepare_text($body,$item['mimetype'])) . '' . "\r\n"; $o .= '' . "\r\n"; if($item['location']) { -- cgit v1.2.3