Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix HTML display of multipart messages with truncated parts (#4462) #6331

Merged
merged 3 commits into from
Dec 12, 2024

Conversation

iequidoo
Copy link
Collaborator

Fix #4462
See commit messages. I suggest to fix this somehow to avoid huge refactoring. Not sure, but maybe it's even good that we have the full decrypted message structure in mime_headers.

…4462)

Otherwise the "Show Full Message..." button appears somewhere in the middle of the multipart
message, e.g. after a text in the first message bubble, but before a text in the second
bubble. Moreover, if the second/n-th bubble's text is shortened (ends with "[...]"), the user should
scroll up to click on "Show Full Message..." which doesn't look reasonable. Scrolling down looks
more acceptable (e.g. if the first bubble's text is shortened in a multipart message).

I'd even suggest to show somehow that message bubbles belong to the same multipart message, e.g. add
"[↵]" to the text of all bubbles except the last one, but let's discuss this first.
This fixes the HTML display of messages containing forwarded messages. Before, forwarded messages
weren't rendered in HTML and if a forwarded message is long and therefore truncated in the chat, it
could only be seen in the "Message Info". In #4462 it was suggested to display "Show Full
Message..." for each truncated message part and save to `msgs.mime_headers` only the corresponding
part, but this is a quite huge change and refactoring and also it may be good that currently we save
the full message structure to `msgs.mime_headers`, so i'd suggest not to change this for now.
@@ -100,8 +107,8 @@ impl HtmlMsgParser {
} else {
parser.cid_to_data_recursive(context, &parsedmail).await?;
}

Ok(parser)
parser.html += &mem::take(&mut parser.msg_html);
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This results in several html documents joined sequentially, Firefox displays it w/o any problems, but this should be checked in the Delta Chat apps as well

Copy link
Collaborator Author

@iequidoo iequidoo Dec 11, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Doesn't work in DC Desktop, only the first HTML is shown :( Will join them into one HTML document then.

EDIT: Works at least on Desktop. On Android i didn't check, but i checked that the default HTML viewer shows such a concatenated HTML as expected, so going to merge this...

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Probably it's not feasible to join HTMLs into one anyway, one HTML can be sent by another MUA, another one generated locally f.e.

@iequidoo iequidoo marked this pull request as ready for review December 10, 2024 20:03
@iequidoo iequidoo requested a review from link2xt December 10, 2024 20:04
@iequidoo iequidoo marked this pull request as draft December 11, 2024 14:24
@iequidoo iequidoo marked this pull request as ready for review December 12, 2024 14:29
@iequidoo iequidoo merged commit cb21578 into main Dec 12, 2024
37 checks passed
@iequidoo iequidoo deleted the iequidoo/big_forwarded_with_big_attachment branch December 12, 2024 14:30
@iequidoo
Copy link
Collaborator Author

iequidoo commented Dec 12, 2024

I'd even suggest to show somehow that message bubbles belong to the same multipart message, e.g. add
"[↵]" to the text of all bubbles except the last one. CC @r10s @link2xt

@link2xt
Copy link
Collaborator

link2xt commented Dec 12, 2024

If adding something like ↩️ is easy, then could be added. But if it is not trivial, then supporting multi-part non-delta chat messages is very low priority I'd say.

@iequidoo
Copy link
Collaborator Author

If adding something like ↩️ is easy, then could be added. But if it is not trivial, then supporting multi-part non-delta chat messages is very low priority I'd say.

Decided not to do this, it would be nice to show somehow that message bubbles belong to the same multipart message, but just adding ↩️ worsens "Reply" and "Copy Text" experience.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

No HTML if multiple text parts are cut
2 participants