diff options
author | redmatrix <git@macgirvin.com> | 2016-02-17 15:56:30 -0800 |
---|---|---|
committer | redmatrix <git@macgirvin.com> | 2016-02-17 15:56:30 -0800 |
commit | 161050df074bffdacf9fc39f042d17dd84f63ee5 (patch) | |
tree | 267b4b1598c16975d96f52a3df4b9e65627732c1 /include | |
parent | 29284319a560af8d3888aadd333e57d7e21ecfeb (diff) | |
download | volse-hubzilla-161050df074bffdacf9fc39f042d17dd84f63ee5.tar.gz volse-hubzilla-161050df074bffdacf9fc39f042d17dd84f63ee5.tar.bz2 volse-hubzilla-161050df074bffdacf9fc39f042d17dd84f63ee5.zip |
format atom event renderings so they are reasonably compatible with GNU-social
Diffstat (limited to 'include')
-rwxr-xr-x | include/items.php | 17 |
1 files changed, 15 insertions, 2 deletions
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 .= '<thr:in-reply-to ref="' . xmlify($parent_item) . '" type="text/html" href="' . xmlify($item['plink']) . '" />' . "\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 .= '<title>' . xmlify($item['title']) . '</title>' . "\r\n"; + $o .= '<summary>' . xmlify(bbcode($obj['title'])) . '</summary>' . "\r\n"; + $o .= '<dtstart xmlns="urn:ietf:params:xml:ns:xcal">' . datetime_convert('UTC','UTC', $obj['start'],'Ymd\\THis' . (($obj['adjust']) ? '\\Z' : '')) . '</dtstart>' . "\r\n"; + $o .= '<dtend xmlns="urn:ietf:params:xml:ns:xcal">' . datetime_convert('UTC','UTC', $obj['finish'],'Ymd\\THis' . (($obj['adjust']) ? '\\Z' : '')) . '</dtend>' . "\r\n"; + $o .= '<location>' . bbcode($obj['location']) . '</location>' . "\r\n"; + $o .= '<content type="' . $type . '" >' . xmlify(bbcode($obj['description'])) . '</content>' . "\r\n"; + } + else { + $o .= '<title>' . xmlify($item['title']) . '</title>' . "\r\n"; + $o .= '<content type="' . $type . '" >' . xmlify(prepare_text($body,$item['mimetype'])) . '</content>' . "\r\n"; + } + $o .= '<id>' . xmlify($item['mid']) . '</id>' . "\r\n"; - $o .= '<title>' . xmlify($item['title']) . '</title>' . "\r\n"; $o .= '<published>' . xmlify(datetime_convert('UTC','UTC',$item['created'] . '+00:00',ATOM_TIME)) . '</published>' . "\r\n"; $o .= '<updated>' . xmlify(datetime_convert('UTC','UTC',$item['edited'] . '+00:00',ATOM_TIME)) . '</updated>' . "\r\n"; - $o .= '<content type="' . $type . '" >' . xmlify(prepare_text($body,$item['mimetype'])) . '</content>' . "\r\n"; $o .= '<link rel="alternate" type="text/html" href="' . xmlify($item['plink']) . '" />' . "\r\n"; if($item['location']) { |