deltachat / deltachat-core-rust

Delta Chat Rust Core library, used by Android/iOS/desktop apps, bindings and bots 📧
https://delta.chat/en/contribute
Other
659 stars 85 forks source link

truncate long URLs and long texts #3478

Closed condr-at closed 12 months ago

condr-at commented 2 years ago

URLs in default emails often very long because they has a lot of parameters, so message bubble grows to multiple screens even if original message is short.

r10s commented 2 years ago

yip, this is an issue. the long urls mainly comes from html-mails converted to plain text. same for other stuff that is not really content.

the idea is to truncate these html-mails massively to at most 20 lines or so - or just before the first long url. then., the "show full message" button will be more visilbe - and the full message view usually shows these urls without issues.

however, all that cannot be done in ios but needs to be done in core; we should file an issue for that at some point.

Simon-Laux commented 2 years ago

Desktop and the https://github.com/deltachat/message-parser both support labeled links: [label](link), that could be an alternative solution to just cutting them short and displaying "read full message" button.

the idea is to truncate these html-mails massively to at most 20 lines or so

I have a branch that implements cutting by lines, I will make an pr soon.

Edit: the pr is ready https://github.com/deltachat/deltachat-core-rust/pull/3480

r10s commented 2 years ago

i think, we should just stop trying to convert complex html code to plain text, labeled links can maybe mitigate stuff, but not really fix the issue when some bleiwüste comes in.

adbenitez commented 2 years ago

probably will be already an improvement to change DC_DESIRED_TEXT_LEN to something like 2000 in src/constants.rs

link2xt commented 12 months ago

With #3480 merged we can consider the issue to be fixed. Parsing the message and finding URLs to truncate is a task for the UI and message parser.