[TikiWiki-commits] [Git][tikiwiki/tiki][master] [ENH] Use HTML content of the email for events created through Cypht
"Victor Emanouilov \(@kroky\) via TikiWiki-cvs" <[email protected]>
| Newsgroups | gmane.comp.cms.tiki.cvs |
|---|---|
| Message-ID | <68d3d4c1b4f7c_2cdf37c804a@gitlab-sidekiq-low-urgency-cpu-bound-v2-69d75bf97c-vfl92.mail> |
Victor Emanouilov pushed to branch master at Tiki Wiki CMS Groupware / Tiki
Commits:
93f6e7c4 by Merci Jacob at 2025-09-24T11:15:51+00:00
[ENH] Use HTML content of the email for events created through Cypht
---
* spare the utilities of the description overriding
* [ENH] Use HTML content of the email for events created through Cypht
See merge request tikiwiki/tiki!8620
- - - - -
1 changed file:
- lib/cypht/modules/tiki/calendar_modules.php
Changes:
=====================================
lib/cypht/modules/tiki/calendar_modules.php
=====================================
@@ -29,6 +29,9 @@ class Hm_Handler_check_calendar_invitations_imap extends Hm_Handler_Module
}
if ($this->get('calendar_event_raw')) {
$event = Tiki\SabreDav\Utilities::getDenormalizedData($this->get('calendar_event_raw'));
+ if ($this->get('formatted_calendar_event_description')) {
+ $event['description'] = $this->get('formatted_calendar_event_description');
+ }
$this->out('calendar_event', $event);
} else {
$event = null;
@@ -512,14 +515,18 @@ class Hm_Output_add_rsvp_actions extends Hm_Output_Module
if (! hm_exists('get_calendar_part_imap')) {
function get_calendar_part_imap($struct, $mod)
{
- $event = $method = null;
+ $event = $method = $html = null;
$part = false;
+ $htmlPart = false;
foreach ($struct as $id => $vals) {
if (is_array($vals) && isset($vals['type'])) {
if ($vals['type'] . '/' . $vals['subtype'] == 'text/calendar') {
$part = $id;
$method = $vals['attributes']['method'];
}
+ if ($vals['type'] . '/' . $vals['subtype'] == 'text/html') {
+ $htmlPart = $id;
+ }
if (isset($vals['subs'])) {
return get_calendar_part_imap($vals['subs'], $mod);
}
@@ -537,9 +544,15 @@ if (! hm_exists('get_calendar_part_imap')) {
$mailbox = Hm_IMAP_List::get_connected_mailbox($form['imap_server_id'], $mod->cache);
if ($mailbox->authed()) {
$event = $mailbox->get_structured_message(hex2bin($form['folder']), $form['imap_msg_uid'], $part, true)[2];
+ if ($htmlPart) {
+ $html = $mailbox->get_structured_message(hex2bin($form['folder']), $form['imap_msg_uid'], $htmlPart, true)[2];
+ $html = sanitize_email_html($html);
+ $html = format_msg_html($html);
+ }
}
}
$mod->out('calendar_method', $method);
$mod->out('calendar_event_raw', $event);
+ $mod->out('formatted_calendar_event_description', $html);
}
}
View it on GitLab: https://gitlab.com/tikiwiki/tiki/-/commit/93f6e7c4c60eb2737515483d7e1acf7f74b3f501
--
View it on GitLab: https://gitlab.com/tikiwiki/tiki/-/commit/93f6e7c4c60eb2737515483d7e1acf7f74b3f501
You're receiving this email because of your account on gitlab.com.
_______________________________________________
TikiWiki-cvs mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/tikiwiki-cvs