diff options
author | Mario <mario@mariovavti.com> | 2022-05-16 20:44:53 +0000 |
---|---|---|
committer | Mario <mario@mariovavti.com> | 2022-05-16 20:44:53 +0000 |
commit | c1dc16a89dedd029f4cb206009c6ef7d66626c01 (patch) | |
tree | 5652c48329fe01dfadf5ef98fb09d4cab29896c2 | |
parent | 66436ce4a2c017b2de167310f302fc5b0c4c6f60 (diff) | |
download | volse-hubzilla-c1dc16a89dedd029f4cb206009c6ef7d66626c01.tar.gz volse-hubzilla-c1dc16a89dedd029f4cb206009c6ef7d66626c01.tar.bz2 volse-hubzilla-c1dc16a89dedd029f4cb206009c6ef7d66626c01.zip |
make sure we use source.content when rendering events to correctly render observer related content. fix wrong media types.
-rw-r--r-- | Zotlabs/Lib/MessageFilter.php | 2 | ||||
-rw-r--r-- | include/event.php | 15 |
2 files changed, 12 insertions, 5 deletions
diff --git a/Zotlabs/Lib/MessageFilter.php b/Zotlabs/Lib/MessageFilter.php index 95721e7c7..70b0188c4 100644 --- a/Zotlabs/Lib/MessageFilter.php +++ b/Zotlabs/Lib/MessageFilter.php @@ -8,7 +8,7 @@ class MessageFilter { public static function evaluate($item, $incl, $excl) { - $text = prepare_text($item['body'],((isset($item['mimetype'])) ? $item['mimetype'] : 'text/x-multicode')); + $text = prepare_text($item['body'],((isset($item['mimetype'])) ? $item['mimetype'] : 'text/bbcode')); $text = html2plain(($item['title']) ? $item['title'] . ' ' . $text : $text); $lang = null; diff --git a/include/event.php b/include/event.php index 3d3dda035..f62c22792 100644 --- a/include/event.php +++ b/include/event.php @@ -85,7 +85,7 @@ function format_event_obj($jobject) { 'startTime' => (($arr['adjust']) ? datetime_convert('UTC','UTC',$arr['dtstart'], ATOM_TIME) : datetime_convert('UTC','UTC',$arr['dtstart'],'Y-m-d\\TH:i:s-00:00')), 'content' => bbcode($arr['description']), 'location' => [ 'type' => 'Place', 'content' => $arr['location'] ], - 'source' => [ 'content' => format_event_bbcode($arr), 'mediaType' => 'text/x-multicode' ], + 'source' => [ 'content' => format_event_bbcode($arr), 'mediaType' => 'text/bbcode' ], 'url' => [ [ 'mediaType' => 'text/calendar', 'href' => z_root() . '/events/ical/' . $event['event_hash'] ] ], 'actor' => Activity::encode_person($r[0],false), ]; @@ -141,8 +141,15 @@ function format_event_obj($jobject) { '$event_tz' => ['label' => t('Timezone'), 'value' => (($tz === date_default_timezone_get()) ? '' : $tz)] )); + + $description = []; + + if (strpos($object['source']['content'], '[/event-description]') !== false) { + preg_match("/\[event\-description\](.*?)\[\/event\-description\]/ism", $object['source']['content'], $description); + } + $event['content'] = replace_macros(get_markup_template('event_item_content.tpl'), array( - '$description' => $object['content'], + '$description' => ((isset($description[1]))? zidify_links(smilies(bbcode($description[1]))) : EMPTY_STR), '$location_label' => t('Location:'), '$location' => ((array_path_exists('location/name', $object)) ? zidify_links(smilies(bbcode($object['location']['name']))) : EMPTY_STR) )); @@ -1215,7 +1222,7 @@ function event_store_item($arr, $event) { 'startTime' => (($arr['adjust']) ? datetime_convert('UTC', 'UTC', $arr['dtstart'], ATOM_TIME) : datetime_convert('UTC', 'UTC', $arr['dtstart'], 'Y-m-d\\TH:i:s-00:00')), 'content' => bbcode($arr['description']), 'location' => [ 'type' => 'Place', 'name' => $arr['location'] ], - 'source' => [ 'content' => format_event_bbcode($arr), 'mediaType' => 'text/x-multicode' ], + 'source' => [ 'content' => format_event_bbcode($arr), 'mediaType' => 'text/bbcode' ], 'url' => [ [ 'mediaType' => 'text/calendar', 'href' => z_root() . '/events/ical/' . $event['event_hash'] ] ], 'actor' => Activity::encode_person($r[0], false), 'attachment' => Activity::encode_attachment($r[0]), @@ -1375,7 +1382,7 @@ function event_store_item($arr, $event) { 'startTime' => (($arr['adjust']) ? datetime_convert('UTC', 'UTC', $arr['dtstart'], ATOM_TIME) : datetime_convert('UTC', 'UTC', $arr['dtstart'], 'Y-m-d\\TH:i:s-00:00')), 'content' => bbcode($arr['description']), 'location' => [ 'type' => 'Place', 'name' => bbcode($arr['location']) ], - 'source' => [ 'content' => format_event_bbcode($arr), 'mediaType' => 'text/x-multicode' ], + 'source' => [ 'content' => format_event_bbcode($arr), 'mediaType' => 'text/bbcode' ], 'url' => [ [ 'mediaType' => 'text/calendar', 'href' => z_root() . '/events/ical/' . $event['event_hash'] ] ], 'actor' => Activity::encode_person($z, false), 'attachment' => Activity::encode_attachment($item_arr), |