From 36983966777959e7a46a09feea762766585f3332 Mon Sep 17 00:00:00 2001 From: John Preston Date: Wed, 10 Aug 2022 16:41:48 +0300 Subject: [PATCH] Remove MTP from Polls::create interface. --- Telegram/SourceFiles/api/api_polls.cpp | 4 ++-- Telegram/SourceFiles/api/api_polls.h | 2 +- Telegram/SourceFiles/window/window_peer_menu.cpp | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/Telegram/SourceFiles/api/api_polls.cpp b/Telegram/SourceFiles/api/api_polls.cpp index 7f4924a41..d90198df4 100644 --- a/Telegram/SourceFiles/api/api_polls.cpp +++ b/Telegram/SourceFiles/api/api_polls.cpp @@ -37,7 +37,7 @@ void Polls::create( const PollData &data, const SendAction &action, Fn done, - Fn fail) { + Fn 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(); diff --git a/Telegram/SourceFiles/api/api_polls.h b/Telegram/SourceFiles/api/api_polls.h index 29ffe3142..2ff08a1ac 100644 --- a/Telegram/SourceFiles/api/api_polls.h +++ b/Telegram/SourceFiles/api/api_polls.h @@ -29,7 +29,7 @@ public: const PollData &data, const SendAction &action, Fn done, - Fn fail); + Fn fail); void sendVotes( FullMsgId itemId, const std::vector &options); diff --git a/Telegram/SourceFiles/window/window_peer_menu.cpp b/Telegram/SourceFiles/window/window_peer_menu.cpp index c3becab69..95ff92154 100644 --- a/Telegram/SourceFiles/window/window_peer_menu.cpp +++ b/Telegram/SourceFiles/window/window_peer_menu.cpp @@ -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)); }));