2
0
mirror of https://github.com/telegramdesktop/tdesktop synced 2025-08-31 06:26:18 +00:00

Make MTP::Session handle the connection thread.

This commit is contained in:
John Preston
2019-11-27 17:22:22 +03:00
parent 06f5f7f7d9
commit c742d7406c
10 changed files with 277 additions and 367 deletions

View File

@@ -453,18 +453,14 @@ void Account::destroyMtpKeys(MTP::AuthKeysList &&keys) {
Core::App().dcOptions(),
MTP::Instance::Mode::KeysDestroyer,
std::move(destroyConfig));
QObject::connect(
_mtpForKeysDestroy.get(),
&MTP::Instance::allKeysDestroyed,
[=] { allKeysDestroyed(); });
}
void Account::allKeysDestroyed() {
LOG(("MTP Info: all keys scheduled for destroy are destroyed."));
crl::on_main(this, [=] {
_mtpForKeysDestroy = nullptr;
Local::writeMtpData();
});
_mtpForKeysDestroy->allKeysDestroyed(
) | rpl::start_with_next([=] {
LOG(("MTP Info: all keys scheduled for destroy are destroyed."));
crl::on_main(this, [=] {
_mtpForKeysDestroy = nullptr;
Local::writeMtpData();
});
}, _lifetime);
}
void Account::suggestMainDcId(MTP::DcId mainDcId) {