summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGeorge Hazan <ghazan@miranda.im>2023-02-10 13:17:48 +0300
committerGeorge Hazan <ghazan@miranda.im>2023-02-10 13:17:48 +0300
commit2046bf33c966d9db3fbc98c1e067788408751104 (patch)
tree825358156c2566bb0ea46d0589c844ba0d60985e
parentef0ba268b340eaf1217a96d763342c25668588b4 (diff)
Telegram: removes a contact from server when it's deleted locally
-rw-r--r--protocols/Telegram/src/proto.cpp10
-rw-r--r--protocols/Telegram/src/proto.h1
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;