deltachat-core
deltachat-core copied to clipboard
truncate messages saved in the database?
afaik, currently, there is no limit in message lengths that is written to the database.
however, there is a limit of the number of characters that is returned in dc_msg_get_text() (currently max. 30kb)
while longer texts (say several mb) are no problem in general, they can cause problems eg. on the current fulltext search implementation which is basically a LIKE '%pattern%'
query (yes, it can also be improved), but very long texts may cause any kind of other problems as well.
also, the typical controls are not capable of displaying long text.
so, i would suggest to not write very long texts to the database txt
field. however, it can be written to the txt_raw
field. another idea may be to convert these long text to an attachment, however, this may be a bit unexpected and also, typically, these long text are not really "user typed" text, it's more uuencoded stuff or pgp-armored-messages or so.
I vote for truncate it, but then add a remark in text, like "=== message truncated ===" or so.
in fact, messages are already truncated now, eg. full quotes are truncated. truncated parts are marked by [...]
then.
If that's the marker: Ok
I didn't saw that marker it in that way. I more assumed that the rest of the message is somewhere available if I see "[...]"
Truncate means, no rest available.
I'm ok with that too ;-)