Remove MTP from Polls::create interface.

This commit is contained in:
John Preston 2022-08-10 16:41:48 +03:00
parent d2e1517e7a
commit 3698396677
3 changed files with 4 additions and 4 deletions

View File

@ -37,7 +37,7 @@ void Polls::create(
const PollData &data,
const SendAction &action,
Fn<void()> done,
Fn<void(const MTP::Error &error)> fail) {
Fn<void()> fail) {
_session->api().sendAction(action);
const auto history = action.history;
@ -101,7 +101,7 @@ void Polls::create(
history->finishSavingCloudDraft(
UnixtimeFromMsgId(response.outerMsgId));
}
fail(error);
fail();
finish();
}).afterRequest(history->sendRequestId
).send();

View File

@ -29,7 +29,7 @@ public:
const PollData &data,
const SendAction &action,
Fn<void()> done,
Fn<void(const MTP::Error &error)> fail);
Fn<void()> fail);
void sendVotes(
FullMsgId itemId,
const std::vector<QByteArray> &options);

View File

@ -1064,7 +1064,7 @@ void PeerMenuCreatePoll(
const auto api = &peer->session().api();
api->polls().create(result.poll, action, crl::guard(weak, [=] {
weak->closeBox();
}), crl::guard(weak, [=](const MTP::Error &error) {
}), crl::guard(weak, [=] {
*lock = false;
weak->submitFailed(tr::lng_attach_failed(tr::now));
}));