2
0
mirror of https://github.com/telegramdesktop/tdesktop synced 2025-09-01 15:05:56 +00:00

Call finish takeout. Handle errors.

This commit is contained in:
John Preston
2018-06-21 01:54:59 +01:00
parent fcda883878
commit 36fb6dac89
11 changed files with 113 additions and 14 deletions

View File

@@ -707,6 +707,23 @@ void ApiWrap::requestMessages(
});
}
void ApiWrap::finishExport(FnMut<void()> done) {
const auto guard = gsl::finally([&] { _takeoutId = base::none; });
mainRequest(MTPaccount_FinishTakeoutSession(
MTP_flags(MTPaccount_FinishTakeoutSession::Flag::f_success)
)).done(std::move(done)).send();
}
void ApiWrap::cancelExportFast() {
if (_takeoutId.has_value()) {
const auto requestId = mainRequest(MTPaccount_FinishTakeoutSession(
MTP_flags(0)
)).send();
_mtp.request(requestId).detach();
}
}
void ApiWrap::requestDialogsSlice() {
Expects(_dialogsProcess != nullptr);