summaryrefslogtreecommitdiff
path: root/protocols/Telegram/src/proto.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'protocols/Telegram/src/proto.cpp')
-rw-r--r--protocols/Telegram/src/proto.cpp18
1 files changed, 12 insertions, 6 deletions
diff --git a/protocols/Telegram/src/proto.cpp b/protocols/Telegram/src/proto.cpp
index e112712128..8d15a38f33 100644
--- a/protocols/Telegram/src/proto.cpp
+++ b/protocols/Telegram/src/proto.cpp
@@ -116,22 +116,28 @@ void CTelegramProto::OnContactAdded(MCONTACT hContact)
}
}
-void CTelegramProto::OnContactDeleted(MCONTACT hContact)
+bool CTelegramProto::OnContactDeleted(MCONTACT hContact)
{
TD::int53 id = GetId(hContact);
if (id == 0)
- return;
-
- TD::array<TD::int53> ids;
- ids.push_back(id);
- SendQuery(new TD::removeContacts(std::move(ids)));
+ return false;
if (auto *pUser = FindUser(id)) {
+ if (pUser->m_si) {
+ SvcLeaveChat(hContact, 0);
+ return false;
+ }
+
pUser->hContact = INVALID_CONTACT_ID;
pUser->wszNick = getMStringW(hContact, "Nick");
pUser->wszFirstName = getMStringW(hContact, "FirstName");
pUser->wszLastName = getMStringW(hContact, "LastName");
}
+
+ TD::array<TD::int53> ids;
+ ids.push_back(id);
+ SendQuery(new TD::removeContacts(std::move(ids)));
+ return true;
}
int CTelegramProto::OnEmptyHistory(WPARAM hContact, LPARAM)