Fix #4982: Allow to send unverified securejoin messages to protected chats

This commit is contained in:
Hocuri
2023-11-11 12:13:06 +01:00
committed by holger krekel
parent e4b6eba5d7
commit b26ded423b
2 changed files with 42 additions and 1 deletions

View File

@@ -316,7 +316,15 @@ impl<'a> MimeFactory<'a> {
match &self.loaded {
Loaded::Message { chat } => {
if chat.is_protected() {
PeerstateVerifiedStatus::BidirectVerified
if self.msg.get_info_type() == SystemMessage::SecurejoinMessage {
// Securejoin messages are supposed to verify a key.
// In order to do this, it is necessary that they can be sent
// to a key that is not yet verified.
// This has to work independently of whether the chat is protected right now.
PeerstateVerifiedStatus::Unverified
} else {
PeerstateVerifiedStatus::BidirectVerified
}
} else {
PeerstateVerifiedStatus::Unverified
}