mirror of
https://github.com/chatmail/core.git
synced 2026-05-04 13:56:30 +03:00
fix: MimeFactory::verified: Return true for self-chat
For purposes of building a message it's better to consider the self-chat as verified. Particularly, this removes unencrypted name from the "From" header.
This commit is contained in:
@@ -299,19 +299,12 @@ impl MimeFactory {
|
||||
fn verified(&self) -> bool {
|
||||
match &self.loaded {
|
||||
Loaded::Message { chat, msg } => {
|
||||
if chat.is_protected() {
|
||||
if 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.
|
||||
false
|
||||
} else {
|
||||
true
|
||||
}
|
||||
} else {
|
||||
false
|
||||
}
|
||||
chat.is_self_talk() ||
|
||||
// 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.
|
||||
chat.is_protected() && msg.get_info_type() != SystemMessage::SecurejoinMessage
|
||||
}
|
||||
Loaded::Mdn { .. } => false,
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user