summaryrefslogtreecommitdiff
path: root/protocols/Telegram
diff options
context:
space:
mode:
authorGeorge Hazan <george.hazan@gmail.com>2023-05-14 16:20:11 +0300
committerGeorge Hazan <george.hazan@gmail.com>2023-05-14 16:20:11 +0300
commitf6a94dd224027c964cdefb2061d8a69a7757ad70 (patch)
tree8b07707553200303af98b47dacd260c8b3def781 /protocols/Telegram
parent02e7ae964ebe60b8ff42a914eb6fe61ed3b299c6 (diff)
Telegram: fix for a glitch with Saved contacts' deletion
Diffstat (limited to 'protocols/Telegram')
-rw-r--r--protocols/Telegram/src/server.cpp5
1 files changed, 3 insertions, 2 deletions
diff --git a/protocols/Telegram/src/server.cpp b/protocols/Telegram/src/server.cpp
index 1748a87080..9db267be38 100644
--- a/protocols/Telegram/src/server.cpp
+++ b/protocols/Telegram/src/server.cpp
@@ -638,8 +638,9 @@ void CTelegramProto::ProcessSuperGroup(TD::updateSupergroup *pObj)
void CTelegramProto::ProcessUser(TD::updateUser *pObj)
{
auto *pUser = pObj->user_.get();
+ bool bIsMe = pUser->id_ == m_iOwnId;
- if (!pUser->is_contact_) {
+ if (!bIsMe && !pUser->is_contact_) {
auto *pu = AddFakeUser(pUser->id_, false);
if (pu->hContact != INVALID_CONTACT_ID)
Contact::RemoveFromList(pu->hContact);
@@ -663,7 +664,7 @@ void CTelegramProto::ProcessUser(TD::updateUser *pObj)
}
auto *pu = AddUser(pUser->id_, false);
- MCONTACT hContact = (pUser->id_ == m_iOwnId) ? 0 : pu->hContact;
+ MCONTACT hContact = (bIsMe) ? 0 : pu->hContact;
UpdateString(hContact, "FirstName", pUser->first_name_);
UpdateString(hContact, "LastName", pUser->last_name_);
if (hContact)