diff options
author | George Hazan <ghazan@miranda.im> | 2023-02-10 13:17:48 +0300 |
---|---|---|
committer | George Hazan <ghazan@miranda.im> | 2023-02-10 13:17:48 +0300 |
commit | 2046bf33c966d9db3fbc98c1e067788408751104 (patch) | |
tree | 825358156c2566bb0ea46d0589c844ba0d60985e /protocols | |
parent | ef0ba268b340eaf1217a96d763342c25668588b4 (diff) |
Telegram: removes a contact from server when it's deleted locally
Diffstat (limited to 'protocols')
-rw-r--r-- | protocols/Telegram/src/proto.cpp | 10 | ||||
-rw-r--r-- | protocols/Telegram/src/proto.h | 1 |
2 files changed, 11 insertions, 0 deletions
diff --git a/protocols/Telegram/src/proto.cpp b/protocols/Telegram/src/proto.cpp index 88fc2401ab..1a353da02a 100644 --- a/protocols/Telegram/src/proto.cpp +++ b/protocols/Telegram/src/proto.cpp @@ -88,6 +88,16 @@ CTelegramProto::~CTelegramProto() { } +void CTelegramProto::OnContactDeleted(MCONTACT hContact) +{ + CMStringA szId(getMStringA(hContact, DBKEY_ID)); + if (!szId.IsEmpty()) { + TD::array<TD::int53> ids; + ids.push_back(_atoi64(szId)); + SendQuery(new TD::removeContacts(std::move(ids))); + } +} + void CTelegramProto::OnModulesLoaded() { CMStringA szId(getMStringA(DBKEY_ID)); diff --git a/protocols/Telegram/src/proto.h b/protocols/Telegram/src/proto.h index bb0238d494..d57f873bc3 100644 --- a/protocols/Telegram/src/proto.h +++ b/protocols/Telegram/src/proto.h @@ -241,6 +241,7 @@ public: int SendMsg(MCONTACT hContact, int flags, const char *pszMessage) override; int SetStatus(int iNewStatus) override; + void OnContactDeleted(MCONTACT hContact) override; void OnModulesLoaded() override; void OnShutdown() override; void OnErase() override; |