Plugin API: Call message_part_structure hook for sub-parts of multipart/alternative message (#5678)

pull/5690/head
Aleksander Machniak 7 years ago
parent 51dbc2e438
commit fa32c2c471

@ -1,6 +1,7 @@
CHANGELOG Roundcube Webmail
===========================
- Plugin API: Call message_part_structure hook for sub-parts of multipart/alternative message (#5678)
- Enigma: Always use detached signatures (#5624)
- Enigma: Fix handling of messages with nested PGP encrypted parts (#5634)
- Minimize unwanted message loading in preview frame on drag (#5616)

@ -679,8 +679,9 @@ class rcube_message
$this->parse_alternative = false;
// if plain part was found, we should unset it if html is preferred
if ($this->opt['prefer_html'] && count($this->parts))
if ($this->opt['prefer_html'] && count($this->parts)) {
$plain_part = null;
}
}
// choose html/plain part to print
@ -697,7 +698,15 @@ class rcube_message
// add the right message body
if (is_object($print_part)) {
$print_part->type = 'content';
$this->add_part($print_part);
// Allow plugins to handle also this part
$plugin = $this->app->plugins->exec_hook('message_part_structure',
array('object' => $this, 'structure' => $print_part,
'mimetype' => $print_part->mimetype, 'recursive' => true));
if (!$plugin['abort']) {
$this->add_part($print_part);
}
}
// show plaintext warning
else if ($html_part !== null && empty($this->parts)) {

Loading…
Cancel
Save