mirror of
https://github.com/chatmail/core.git
synced 2026-04-17 21:46:35 +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.extend(to_ids);
|
||||
members.sort_unstable();
|
||||
members.dedup();
|
||||
chat::add_to_chat_contacts_table(context, new_chat_id, &members).await?;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user