From f397526e5fd1d53956caeb97a6178d3449c8c648 Mon Sep 17 00:00:00 2001 From: George Hazan Date: Sun, 2 Mar 2025 16:57:18 +0300 Subject: =?UTF-8?q?fixes=20#4892=20(Telegram:=20=D0=B4=D0=BE=D0=B1=D0=B0?= =?UTF-8?q?=D0=B2=D0=B8=D1=82=D1=8C=20=D0=BF=D0=BE=D0=BA=D0=B0=D0=B7=20?= =?UTF-8?q?=D0=B8=D0=BD=D1=84=D0=BE=D1=80=D0=BC=D0=B0=D1=86=D0=B8=D0=B8=20?= =?UTF-8?q?"=D0=9E=20=D1=81=D0=B5=D0=B1=D0=B5")?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- protocols/Telegram/src/server.cpp | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) (limited to 'protocols/Telegram/src/server.cpp') diff --git a/protocols/Telegram/src/server.cpp b/protocols/Telegram/src/server.cpp index 156af0c4ea..ac7d72562d 100644 --- a/protocols/Telegram/src/server.cpp +++ b/protocols/Telegram/src/server.cpp @@ -347,7 +347,8 @@ void CTelegramProto::ProcessResponse(td::ClientManager::Response response) break; case TD::updateUserFullInfo::ID: - ProcessUserInfo((TD::updateUserFullInfo*)response.object.get()); + if (auto *pObj = (TD::updateUserFullInfo *)response.object.get()) + ProcessUserInfo(pObj->user_id_, pObj->user_full_info_.get()); break; } } @@ -1324,14 +1325,19 @@ void CTelegramProto::ProcessUser(TD::updateUser *pObj) } } -void CTelegramProto::ProcessUserInfo(TD::updateUserFullInfo *pObj) +void CTelegramProto::ProcessUserInfo(TD::int53 userId, TD::userFullInfo *pObj) { - if (auto *pUser = FindUser(pObj->user_id_)) { - auto *pInfo = pObj->user_full_info_.get(); - if (auto *pBirthday = pInfo->birthdate_.get()) { + if (auto *pUser = FindUser(userId)) { + if (auto *pBirthday = pObj->birthdate_.get()) { setWord(pUser->hContact, "BirthDay", pBirthday->day_); setWord(pUser->hContact, "BirthMonth", pBirthday->month_); setWord(pUser->hContact, "BirthYear", pBirthday->year_); } + + if (pObj->bio_) { + CMStringA szNotes(GetFormattedText(pObj->bio_)); + if (!szNotes.IsEmpty()) + setString(pUser->hContact, "Notes", szNotes); + } } } -- cgit v1.2.3