mirror of
https://github.com/chatmail/core.git
synced 2026-04-28 02:46:29 +03:00
Reset group member list when we are added to the group
This makes test_synchronize_member_list_on_group_rejoin pass.
This commit is contained in:
@@ -1438,8 +1438,6 @@ class TestGroupStressTests:
|
||||
lp.sec("ac2: check that ac3 is removed")
|
||||
msg = ac2.wait_next_incoming_message()
|
||||
|
||||
# ac2 did not see that ac3 was removed
|
||||
# FIXME: due to a bug, ac2 thinks ac3 is still in the chat
|
||||
assert len(msg.chat.get_contacts()) == len(chat.get_contacts())
|
||||
|
||||
|
||||
|
||||
@@ -1023,6 +1023,17 @@ fn create_or_lookup_group(
|
||||
// add members to group/check members
|
||||
if recreate_member_list {
|
||||
if !chat::is_contact_in_chat(context, chat_id, DC_CONTACT_ID_SELF) {
|
||||
// Members could have been removed while we were
|
||||
// absent. We can't use existing member list and need to
|
||||
// start from scratch.
|
||||
sql::execute(
|
||||
context,
|
||||
&context.sql,
|
||||
"DELETE FROM chats_contacts WHERE chat_id=?;",
|
||||
params![chat_id],
|
||||
)
|
||||
.ok();
|
||||
|
||||
chat::add_to_chat_contacts_table(context, chat_id, DC_CONTACT_ID_SELF);
|
||||
}
|
||||
if from_id > DC_CONTACT_ID_LAST_SPECIAL
|
||||
|
||||
Reference in New Issue
Block a user