mirror of
https://github.com/chatmail/core.git
synced 2026-04-17 21:46:35 +03:00
refactor: MimeFactory::is_e2ee_guaranteed(): always respect Param::ForcePlaintext
Even if a chat is protected, `Param::ForcePlaintext` in fact disables e2ee. Reflect this behaviour in `MimeFactory::is_e2ee_guaranteed()`.
This commit is contained in:
@@ -286,14 +286,11 @@ impl MimeFactory {
|
||||
fn is_e2ee_guaranteed(&self) -> bool {
|
||||
match &self.loaded {
|
||||
Loaded::Message { chat, msg } => {
|
||||
if chat.is_protected() {
|
||||
return true;
|
||||
}
|
||||
|
||||
!msg.param
|
||||
.get_bool(Param::ForcePlaintext)
|
||||
.unwrap_or_default()
|
||||
&& msg.param.get_bool(Param::GuaranteeE2ee).unwrap_or_default()
|
||||
&& (chat.is_protected()
|
||||
|| msg.param.get_bool(Param::GuaranteeE2ee).unwrap_or_default())
|
||||
}
|
||||
Loaded::Mdn { .. } => false,
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user