mirror of
https://github.com/chatmail/core.git
synced 2026-05-09 01:46:30 +03:00
refactor: use let..else in create_or_lookup_group()
This commit is contained in:
@@ -1829,9 +1829,8 @@ async fn create_or_lookup_group(
|
|||||||
to_ids: &[ContactId],
|
to_ids: &[ContactId],
|
||||||
verified_encryption: &VerifiedEncryption,
|
verified_encryption: &VerifiedEncryption,
|
||||||
) -> Result<Option<(ChatId, Blocked)>> {
|
) -> Result<Option<(ChatId, Blocked)>> {
|
||||||
let grpid = if let Some(grpid) = try_getting_grpid(mime_parser) {
|
let Some(grpid) = try_getting_grpid(mime_parser) else {
|
||||||
grpid
|
if is_partial_download {
|
||||||
} else if is_partial_download {
|
|
||||||
// Partial download may be an encrypted message with protected Subject header.
|
// Partial download may be an encrypted message with protected Subject header.
|
||||||
//
|
//
|
||||||
// We do not want to create a group with "..." or "Encrypted message" as a subject.
|
// We do not want to create a group with "..." or "Encrypted message" as a subject.
|
||||||
@@ -1840,7 +1839,8 @@ async fn create_or_lookup_group(
|
|||||||
"Ad-hoc group cannot be created from partial download."
|
"Ad-hoc group cannot be created from partial download."
|
||||||
);
|
);
|
||||||
return Ok(None);
|
return Ok(None);
|
||||||
} else {
|
}
|
||||||
|
|
||||||
let mut member_ids: Vec<ContactId> = to_ids.to_vec();
|
let mut member_ids: Vec<ContactId> = to_ids.to_vec();
|
||||||
if !member_ids.contains(&(from_id)) {
|
if !member_ids.contains(&(from_id)) {
|
||||||
member_ids.push(from_id);
|
member_ids.push(from_id);
|
||||||
|
|||||||
Reference in New Issue
Block a user