mirror of
https://github.com/chatmail/core.git
synced 2026-10-17 18:33:01 +03:00
this PR adds a new `msg_get_summary_text(add_forwarded, add_type_emoji, approx_chars)` api, replacing the old `get_summarytext(approx_chars)`. checking the concrete existing and new usecases, the new options are required, eg. for: - pinned messages: they do not show the user name (therefore, there should not be a "forward" indicator), and may or may not not e.g. display image left of string (this makes type emoji optional) - notifications, quotes: they show user name (therefore, "forward" indicator needed) and often display e.g. image a bit off (so type emoji is potentially useful, cmp. whatsapp, but potentially also optional) - copy to clipboard: clipboard should get forwarded and emoji, but text should not be truncated and linends should be preserved - esp. the latter was a silent bug in at least android. to support that better, `approx_chars` can be set to `0` to skip truncation and unwrapping. | Use case | `add_forwarded` | `add_type_emoji` | `approx_chars>0` | | --- | :---: | :---: | :---: | | Notification | ✅ | ✅ (potentially ❌) | ✅ | | Quote | ✅ | ✅ (potentially ❌) | ✅ | | Pinned message | ❌ | ❌ (rarely ✅) | ✅ | | Copy to clipboard | ✅ | ✅ | ❌ | | Chatlist (core internal) | ✅ | ✅ | ✅ | | Reaction summary (core internal) | ❌ | ✅ | ✅ | (the get_summary() returning a "lot" can maybe be removed at some point, in favor of adding the usernames directly to get_summary_text() and changing add_forwarded to add_usernames. but that is out of scope) jsonrpc can be added easily once we settle on name etc. references: https://github.com/chatmail/core/pull/8812 , https://github.com/chatmail/core/pull/8546 cc @Amzd , @adbenitez --------- Co-authored-by: Hocuri <hocuri@gmx.de>