diff options
author | George Hazan <ghazan@miranda.im> | 2022-12-29 16:59:37 +0300 |
---|---|---|
committer | George Hazan <ghazan@miranda.im> | 2022-12-29 16:59:37 +0300 |
commit | 5fcdd94995c1673556b59e25067cecf7c3c3bf27 (patch) | |
tree | 4ea252b08b2c7640210f3f39737f6bfcccdfa4fa /protocols | |
parent | e952f242f6314048ec98b60c4d53b0b9c00ab4c0 (diff) |
fixes #3287 (Telegram: при каждом входе прилетают все контакты, с которыми я когда-либо общался)
Diffstat (limited to 'protocols')
-rw-r--r-- | protocols/Telegram/src/server.cpp | 16 |
1 files changed, 10 insertions, 6 deletions
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<TD::chatListMain>(), 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<TD::chatListFilter>(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 |