deltachat-core-rust icon indicating copy to clipboard operation
deltachat-core-rust copied to clipboard

feat: Always allow non-DC reactions to create chats

Open iequidoo opened this issue 7 months ago • 5 comments

This also unifies conditions for creating chats for chatmail and non-chatmail with ShowEmails::All. As for DC reaction messages, they don't contain extra parts, so they mustn't create chats.

Trying to resolve https://github.com/chatmail/core/pull/6767#issuecomment-2777517737

iequidoo avatar Apr 05 '25 02:04 iequidoo

thanks for the idea, however, at a first glance, the existing code seemms easier to read and understand.

usually, on tries to avoid "mut" for that reason.

as it is about is_reaction in classic path - maybe just set the condition there. that would also make the logic change easier to understand and to judge if there maybe was a reason for current logic

r10s avatar Apr 05 '25 05:04 r10s

After re-reading the code, i think that the intention was initially to avoid creating chats for DC reactions, so i changed it in this direction. A little more code, but at least the motivation should be clear now, otherwise the code looks maybe not buggy, but inconsistent.

iequidoo avatar Apr 06 '25 06:04 iequidoo

as it is about is_reaction in classic path - maybe just set the condition there. that would also make the logic change easier to understand and to judge if there maybe was a reason for current logic

Yes, alternatively, we can prevent all reactions from creating chats, anyway it's a corner case. At least this also would make the code consistent.

iequidoo avatar Apr 06 '25 18:04 iequidoo

There are only DC reactions, so checking if the reaction is from DC or not is not useful. Reactions should not create chats indeed, otherwise you get an empty chat.

link2xt avatar Apr 07 '25 16:04 link2xt

IMU of https://www.rfc-editor.org/rfc/rfc9078.html, there may be other message parts, not containing Content-Disposition: reaction, but smth else useful. DC never creates such messages, and if they never exist in practice, we indeed may just add && !is_reaction check in the other branch. Anyway, this corner case isn't that important, so the PR code is ok i think.

EDIT: The code here is stale and it's unclear if it's worth fixing this way.

iequidoo avatar Apr 08 '25 07:04 iequidoo