2
0
mirror of https://github.com/telegramdesktop/tdesktop synced 2025-08-31 14:38:15 +00:00

Return ApiWrap::requestPeerSettings method.

This commit is contained in:
John Preston
2022-08-11 09:57:46 +03:00
parent 8fe48f3ca2
commit 655194c841
2 changed files with 20 additions and 0 deletions

View File

@@ -1131,6 +1131,24 @@ void ApiWrap::gotUserFull(
Data::PeerUpdate::Flag::FullInfo);
}
void ApiWrap::requestPeerSettings(not_null<PeerData*> peer) {
if (!_requestedPeerSettings.emplace(peer).second) {
return;
}
request(MTPmessages_GetPeerSettings(
peer->input
)).done([=](const MTPmessages_PeerSettings &result) {
result.match([&](const MTPDmessages_peerSettings &data) {
_session->data().processUsers(data.vusers());
_session->data().processChats(data.vchats());
peer->setSettings(data.vsettings());
_requestedPeerSettings.erase(peer);
});
}).fail([=] {
_requestedPeerSettings.erase(peer);
}).send();
}
void ApiWrap::migrateChat(
not_null<ChatData*> chat,
FnMut<void(not_null<ChannelData*>)> done,