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:
link2xt
2023-10-28 21:59:56 +00:00
parent a93c79e001
commit 3876846410

View File

@@ -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?;