From 5fcdd94995c1673556b59e25067cecf7c3c3bf27 Mon Sep 17 00:00:00 2001 From: George Hazan Date: Thu, 29 Dec 2022 16:59:37 +0300 Subject: =?UTF-8?q?fixes=20#3287=20(Telegram:=20=D0=BF=D1=80=D0=B8=20?= =?UTF-8?q?=D0=BA=D0=B0=D0=B6=D0=B4=D0=BE=D0=BC=20=D0=B2=D1=85=D0=BE=D0=B4?= =?UTF-8?q?=D0=B5=20=D0=BF=D1=80=D0=B8=D0=BB=D0=B5=D1=82=D0=B0=D1=8E=D1=82?= =?UTF-8?q?=20=D0=B2=D1=81=D0=B5=20=D0=BA=D0=BE=D0=BD=D1=82=D0=B0=D0=BA?= =?UTF-8?q?=D1=82=D1=8B,=20=D1=81=20=D0=BA=D0=BE=D1=82=D0=BE=D1=80=D1=8B?= =?UTF-8?q?=D0=BC=D0=B8=20=D1=8F=20=D0=BA=D0=BE=D0=B3=D0=B4=D0=B0-=D0=BB?= =?UTF-8?q?=D0=B8=D0=B1=D0=BE=20=D0=BE=D0=B1=D1=89=D0=B0=D0=BB=D1=81=D1=8F?= =?UTF-8?q?)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- protocols/Telegram/src/server.cpp | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) (limited to 'protocols') diff --git a/protocols/Telegram/src/server.cpp b/protocols/Telegram/src/server.cpp index 91ebc98fd0..ad7968ba15 100644 --- a/protocols/Telegram/src/server.cpp +++ b/protocols/Telegram/src/server.cpp @@ -54,8 +54,6 @@ void CMTProto::OnLoggedIn() ProtoBroadcastAck(0, ACKTYPE_STATUS, ACKRESULT_SUCCESS, (HANDLE)m_iStatus, m_iDesiredStatus); m_iStatus = m_iDesiredStatus; - - SendQuery(new TD::getChats(td::tl::unique_ptr(), 1000)); } /////////////////////////////////////////////////////////////////////////////// @@ -246,6 +244,8 @@ void CMTProto::ProcessGroups(TD::updateChatFilters *pObj) Clist_GroupRename(oldGroup, wszFullGroup); setWString(szSetting, wszNewValue); } + + SendQuery(new TD::getChats(TD::make_object(grp->id_), 1000)); } } @@ -299,7 +299,14 @@ void CMTProto::ProcessStatus(TD::updateUserStatus *pObj) void CMTProto::ProcessUser(TD::updateUser *pObj) { auto *pUser = pObj->user_.get(); - + + if (pUser->phone_number_ == _T2A(m_szOwnPhone).get()) { + m_iOwnId = pUser->id_; + + if (!FindUser(pUser->id_)) + m_arUsers.insert(new TG_USER(pUser->id_, 0)); + } + auto *pu = AddUser(pUser->id_, false); UpdateString(pu->hContact, "FirstName", pUser->first_name_); UpdateString(pu->hContact, "LastName", pUser->last_name_); @@ -307,9 +314,6 @@ void CMTProto::ProcessUser(TD::updateUser *pObj) if (pUser->usernames_) UpdateString(pu->hContact, "Nick", pUser->usernames_->editable_username_); - if (pUser->phone_number_ == _T2A(m_szOwnPhone).get()) - m_iOwnId = pUser->id_; - if (pUser->is_premium_) ExtraIcon_SetIconByName(g_plugin.m_hIcon, pu->hContact, "tg_premium"); else -- cgit v1.2.3