Skip to content

feat: Allow sending unencrypted for chatmail if SignUnencrypted is set #6809

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 5 additions & 4 deletions src/e2ee.rs
Original file line number Diff line number Diff line change
Expand Up @@ -48,12 +48,13 @@ impl EncryptHelper {
context: &Context,
peerstates: &[(Option<Peerstate>, String)],
) -> Result<bool> {
let is_chatmail = context.is_chatmail().await?;
// For chatmail we ignore the encryption preference,
// because we can either send encrypted or not at all.
let encrypt_if_possible = context.is_chatmail().await?
&& !context.get_config_bool(Config::SignUnencrypted).await?;
for (peerstate, _addr) in peerstates {
if let Some(peerstate) = peerstate {
// For chatmail we ignore the encryption preference,
// because we can either send encrypted or not at all.
if is_chatmail || peerstate.prefer_encrypt != EncryptPreference::Reset {
if encrypt_if_possible || peerstate.prefer_encrypt != EncryptPreference::Reset {
continue;
}
}
Expand Down
Loading