mirror of
https://github.com/chatmail/core.git
synced 2026-04-22 16:06:30 +03:00
refactor: is_probably_private_reply: Remove reaction-specific code
Instead, look up the 1:1 chat in `receive_imf::add_parts()`. This is a more generic approach to fix assigning outgoing reactions to 1:1 chats in the multi-device setup. Although currently both approaches give the same result, this way we can even implement a "react privately" functionality. Maybe it sounds useless, but it seems better to have less reaction-specific code.
This commit is contained in:
@@ -1077,6 +1077,12 @@ async fn add_parts(
|
||||
chat_id_blocked = chat.blocked;
|
||||
}
|
||||
}
|
||||
if chat_id.is_none() && is_dc_message == MessengerMessage::Yes {
|
||||
if let Some(chat) = ChatIdBlocked::lookup_by_contact(context, to_id).await? {
|
||||
chat_id = Some(chat.id);
|
||||
chat_id_blocked = chat.blocked;
|
||||
}
|
||||
}
|
||||
|
||||
// automatically unblock chat when the user sends a message
|
||||
if chat_id_blocked != Blocked::Not {
|
||||
@@ -1722,11 +1728,6 @@ async fn is_probably_private_reply(
|
||||
}
|
||||
}
|
||||
|
||||
let is_reaction = mime_parser.parts.iter().any(|part| part.is_reaction);
|
||||
if is_reaction {
|
||||
return Ok(false);
|
||||
}
|
||||
|
||||
Ok(true)
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user