diff options
author | George Hazan <george.hazan@gmail.com> | 2023-11-25 14:12:03 +0300 |
---|---|---|
committer | George Hazan <george.hazan@gmail.com> | 2023-11-25 14:12:03 +0300 |
commit | e9b8599fe66f6cdc2a3b691b1ae3fc5d9fbdb615 (patch) | |
tree | ae2aae64ce9e57767303fd4178e8289cd404787a /protocols | |
parent | 8bd63c2fb2e8578a5b084838872bedc2cd29227e (diff) |
fixes #3957 (Telegram: импорт контактов приводит к задваиванию после логина)
Diffstat (limited to 'protocols')
-rw-r--r-- | protocols/Telegram/src/proto.cpp | 9 | ||||
-rw-r--r-- | protocols/Telegram/src/proto.h | 1 |
2 files changed, 10 insertions, 0 deletions
diff --git a/protocols/Telegram/src/proto.cpp b/protocols/Telegram/src/proto.cpp index c842a623aa..d275c046d5 100644 --- a/protocols/Telegram/src/proto.cpp +++ b/protocols/Telegram/src/proto.cpp @@ -107,6 +107,15 @@ CTelegramProto::~CTelegramProto() { } +void CTelegramProto::OnContactAdded(MCONTACT hContact) +{ + if (int64_t id = GetId(hContact)) { + auto *pUser = new TG_USER(id, hContact, isChatRoom(hContact)); + pUser->szAvatarHash = getMStringA(hContact, DBKEY_AVATAR_HASH); + m_arUsers.insert(pUser); + } +} + void CTelegramProto::OnContactDeleted(MCONTACT hContact) { TD::int53 id = GetId(hContact); diff --git a/protocols/Telegram/src/proto.h b/protocols/Telegram/src/proto.h index dd1723178b..a11607fd02 100644 --- a/protocols/Telegram/src/proto.h +++ b/protocols/Telegram/src/proto.h @@ -351,6 +351,7 @@ public: int SetStatus(int iNewStatus) override; void OnBuildProtoMenu() override; + void OnContactAdded(MCONTACT hContact) override; void OnContactDeleted(MCONTACT hContact) override; MWindow OnCreateAccMgrUI(MWindow hwndParent) override; void OnErase() override; |