mirror of
https://github.com/chatmail/core.git
synced 2026-04-20 15:06:30 +03:00
fix: Cross-account forwarding of a message which has_html() (#7791)
This includes forwarding of long messages. Also this fixes sending, but more likely resending of forwarded messages for which the original message was deleted, because now we save HTML to the db immediately when creating a forwarded message. Co-authored-by: Hocuri <hocuri@gmx.de>
This commit is contained in:
@@ -1934,15 +1934,19 @@ impl MimeFactory {
|
||||
|
||||
let mut parts = Vec::new();
|
||||
|
||||
// add HTML-part, this is needed only if a HTML-message from a non-delta-client is forwarded;
|
||||
// for simplificity and to avoid conversion errors, we're generating the HTML-part from the original message.
|
||||
if msg.has_html() {
|
||||
let html = if let Some(orig_msg_id) = msg.param.get_int(Param::Forwarded) {
|
||||
let html = if let Some(html) = msg.param.get(Param::SendHtml) {
|
||||
Some(html.to_string())
|
||||
} else if let Some(orig_msg_id) = msg.param.get_int(Param::Forwarded)
|
||||
&& orig_msg_id != 0
|
||||
{
|
||||
// Legacy forwarded messages may not have `Param::SendHtml` set. Let's hope the
|
||||
// original message exists.
|
||||
MsgId::new(orig_msg_id.try_into()?)
|
||||
.get_html(context)
|
||||
.await?
|
||||
} else {
|
||||
msg.param.get(Param::SendHtml).map(|s| s.to_string())
|
||||
None
|
||||
};
|
||||
if let Some(html) = html {
|
||||
main_part = MimePart::new(
|
||||
|
||||
Reference in New Issue
Block a user