deltachat-core-rust
deltachat-core-rust copied to clipboard
feat: Always allow non-DC reactions to create chats
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
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
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.
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.
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.
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.