Skip to content

Commit

Permalink
fix: treat reset state as encryption not preferred
Browse files Browse the repository at this point in the history
This will still degrade 1:1 chats to no encryption,
but will not cause the group to disable encryption
simply because one user got into reset state.
  • Loading branch information
link2xt committed Nov 7, 2023
1 parent cc80590 commit 14adcdb
Showing 1 changed file with 1 addition and 6 deletions.
7 changes: 1 addition & 6 deletions src/e2ee.rs
Original file line number Diff line number Diff line change
Expand Up @@ -67,13 +67,8 @@ impl EncryptHelper {
"peerstate for {:?} is {}", addr, peerstate.prefer_encrypt
);
match peerstate.prefer_encrypt {
EncryptPreference::NoPreference => {}
EncryptPreference::NoPreference | EncryptPreference::Reset => {}
EncryptPreference::Mutual => prefer_encrypt_count += 1,
EncryptPreference::Reset => {
if !e2ee_guaranteed {
return Ok(false);
}
}
};
}
None => {
Expand Down

0 comments on commit 14adcdb

Please sign in to comment.