mirror of
https://github.com/chatmail/core.git
synced 2026-05-01 20:36:31 +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 {
|
fn is_e2ee_guaranteed(&self) -> bool {
|
||||||
match &self.loaded {
|
match &self.loaded {
|
||||||
Loaded::Message { chat, msg } => {
|
Loaded::Message { chat, msg } => {
|
||||||
if chat.is_protected() {
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
!msg.param
|
!msg.param
|
||||||
.get_bool(Param::ForcePlaintext)
|
.get_bool(Param::ForcePlaintext)
|
||||||
.unwrap_or_default()
|
.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,
|
Loaded::Mdn { .. } => false,
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user