Remove obsolete ChatId::is_unset check

The get_chat_id_by_grpid() call is already resultified.  The database
can only contain consistent data since on creation it inserts rows for
the special chats which do not have a grpid set so can never match.
Thus we can safely remove another use of the ChatId::is_unset call
which should be removed to clean up the type.
This commit is contained in:
Floris Bruynooghe
2021-02-07 20:38:48 +01:00
committed by link2xt
parent 24602ed8a8
commit d3b66cf724

View File

@@ -1622,13 +1622,11 @@ pub(crate) async fn prefetch_should_download(
// deleted from the database or has not arrived yet. // deleted from the database or has not arrived yet.
if let Some(rfc724_mid) = headers.get_header_value(HeaderDef::MessageId) { if let Some(rfc724_mid) = headers.get_header_value(HeaderDef::MessageId) {
if let Some(group_id) = dc_extract_grpid_from_rfc724_mid(&rfc724_mid) { if let Some(group_id) = dc_extract_grpid_from_rfc724_mid(&rfc724_mid) {
if let Ok((chat_id, _, _)) = get_chat_id_by_grpid(context, group_id).await { if let Ok((_chat_id, _, _)) = get_chat_id_by_grpid(context, group_id).await {
if !chat_id.is_unset() {
return Ok(true); return Ok(true);
} }
} }
} }
}
let maybe_ndn = if let Some(from) = headers.get_header_value(HeaderDef::From_) { let maybe_ndn = if let Some(from) = headers.get_header_value(HeaderDef::From_) {
let from = from.to_ascii_lowercase(); let from = from.to_ascii_lowercase();