mirror of
https://github.com/chatmail/core.git
synced 2026-05-22 16:26:31 +03:00
refactor: sort member vector before deduplicating
Otherwise SELF contact in the beginning of the vector and in to_ids may be repeated twice and not deduplicated. dedup() only deduplicates consecutive elements.
This commit is contained in:
@@ -1657,6 +1657,7 @@ async fn create_or_lookup_group(
|
|||||||
members.push(from_id);
|
members.push(from_id);
|
||||||
}
|
}
|
||||||
members.extend(to_ids);
|
members.extend(to_ids);
|
||||||
|
members.sort_unstable();
|
||||||
members.dedup();
|
members.dedup();
|
||||||
chat::add_to_chat_contacts_table(context, new_chat_id, &members).await?;
|
chat::add_to_chat_contacts_table(context, new_chat_id, &members).await?;
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user