mimefactory: do not check if the key exists before rendering Autocrypt-Gossip

`render_gossip_header()` returns `None` in this case anyway.
This commit is contained in:
link2xt
2023-01-24 10:06:33 +00:00
parent 800125c7a9
commit d522b7ef1e

View File

@@ -694,15 +694,12 @@ impl<'a> MimeFactory<'a> {
&& self.should_do_gossip(context).await? && self.should_do_gossip(context).await?
{ {
for peerstate in peerstates.iter().filter_map(|(state, _)| state.as_ref()) { for peerstate in peerstates.iter().filter_map(|(state, _)| state.as_ref()) {
if peerstate.peek_key(min_verified).is_some() {
if let Some(header) = peerstate.render_gossip_header(min_verified) { if let Some(header) = peerstate.render_gossip_header(min_verified) {
message = message = message.header(Header::new("Autocrypt-Gossip".into(), header));
message.header(Header::new("Autocrypt-Gossip".into(), header));
is_gossiped = true; is_gossiped = true;
} }
} }
} }
}
// Set the appropriate Content-Type for the inner message. // Set the appropriate Content-Type for the inner message.
let mut existing_ct = message let mut existing_ct = message