2
0
mirror of https://github.com/ars3niy/tdlib-purple synced 2025-08-31 05:55:08 +00:00

Remove chats from contact list when we are no longer group member

This commit is contained in:
Arseniy Lartsev
2020-05-22 13:46:37 +02:00
parent 2b74471a42
commit d455c2ddc9
4 changed files with 83 additions and 4 deletions

View File

@@ -1042,7 +1042,10 @@ void PurpleTdClient::updateChat(const td::td_api::chat *chat)
// For chats, find_chat doesn't work if account is not yet connected, so just in case, don't
// user find_buddy either
if (purple_account_is_connected(m_account) && isChatInContactList(*chat, privateChatUser)) {
if (!purple_account_is_connected(m_account))
return;
if (isChatInContactList(*chat, privateChatUser)) {
if (privateChatUser)
updatePrivateChat(m_data, *chat, *privateChatUser);
@@ -1053,6 +1056,8 @@ void PurpleTdClient::updateChat(const td::td_api::chat *chat)
}
if (supergroupId)
updateSupergroupChat(m_data, supergroupId);
} else {
removeGroupChat(m_account, *chat);
}
}