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:
iequidoo
2024-04-02 21:55:56 -03:00
committed by iequidoo
parent e465415039
commit d39c8a3a19
3 changed files with 37 additions and 8 deletions

View File

@@ -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)
}