diff options
author | George Hazan <george.hazan@gmail.com> | 2023-11-07 15:03:57 +0300 |
---|---|---|
committer | George Hazan <george.hazan@gmail.com> | 2023-11-07 15:04:01 +0300 |
commit | 1eb729352a8b1b19bc8304d97503424548bc90e3 (patch) | |
tree | 7d540d4552d9f77cca909a606c2aea198d637126 /protocols/Telegram/src/proto.cpp | |
parent | c95e25f0865ca0ed3b8f1a25988f936ad1761fea (diff) |
fixes #3798 (Telegram: не удаётся добавить контакт в ростер)
Diffstat (limited to 'protocols/Telegram/src/proto.cpp')
-rw-r--r-- | protocols/Telegram/src/proto.cpp | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/protocols/Telegram/src/proto.cpp b/protocols/Telegram/src/proto.cpp index e6de52e581..9a79af6d94 100644 --- a/protocols/Telegram/src/proto.cpp +++ b/protocols/Telegram/src/proto.cpp @@ -278,6 +278,28 @@ MCONTACT CTelegramProto::AddToList(int flags, PROTOSEARCHRESULT *psr) return pUser->hContact; } +int CTelegramProto::AuthRequest(MCONTACT hContact, const wchar_t *) +{ + auto *pUser = FindUser(GetId(hContact)); + if (pUser == nullptr) + return 1; // error + + auto cc = TD::make_object<TD::contact>(); + cc->user_id_ = pUser->id; + if (!pUser->wszFirstName.IsEmpty()) + cc->first_name_ = T2Utf(pUser->wszFirstName); + else + cc->first_name_ = getMStringU(hContact, "FirstName").c_str(); + + if (!pUser->wszLastName.IsEmpty()) + cc->last_name_ = T2Utf(pUser->wszLastName); + else + cc->last_name_ = getMStringU(hContact, "LastName").c_str(); + + SendQuery(new TD::addContact(std::move(cc), false)); + return 0; +} + INT_PTR CTelegramProto::GetCaps(int type, MCONTACT) { switch (type) { |