Removed unused MTP::Error from callbacks on fail.

This commit is contained in:
23rd 2021-11-26 23:46:53 +03:00 committed by John Preston
parent 287a35d208
commit 3647241f71
62 changed files with 158 additions and 182 deletions

View file

@ -59,7 +59,7 @@ void AttachedStickers::request(
strongController->show( strongController->show(
Box<StickerSetBox>(strongController, setId), Box<StickerSetBox>(strongController, setId),
Ui::LayerOption::KeepOther); Ui::LayerOption::KeepOther);
}).fail([=](const MTP::Error &error) { }).fail([=] {
_requestId = 0; _requestId = 0;
if (const auto strongController = weak.get()) { if (const auto strongController = weak.get()) {
strongController->show( strongController->show(

View file

@ -132,7 +132,7 @@ void Authorizations::reload() {
}) | ranges::to<List>; }) | ranges::to<List>;
_listChanges.fire({}); _listChanges.fire({});
}); });
}).fail([=](const MTP::Error &error) { }).fail([=] {
_requestId = 0; _requestId = 0;
}).send(); }).send();
} }
@ -196,7 +196,7 @@ void Authorizations::updateTTL(int days) {
MTP_int(days) MTP_int(days)
)).done([=](const MTPBool &result) { )).done([=](const MTPBool &result) {
_ttlRequestId = 0; _ttlRequestId = 0;
}).fail([=](const MTP::Error &result) { }).fail([=] {
_ttlRequestId = 0; _ttlRequestId = 0;
}).send(); }).send();
_ttlDays = days; _ttlDays = days;
@ -218,7 +218,7 @@ void Authorizations::toggleCallsDisabled(uint64 hash, bool disabled) {
MTP_bool(disabled) MTP_bool(disabled)
)).done([=](const MTPBool &) { )).done([=](const MTPBool &) {
_toggleCallsDisabledRequests.remove(hash); _toggleCallsDisabledRequests.remove(hash);
}).fail([=](const MTP::Error &) { }).fail([=] {
_toggleCallsDisabledRequests.remove(hash); _toggleCallsDisabledRequests.remove(hash);
}).send(); }).send();
_toggleCallsDisabledRequests.emplace(hash, id); _toggleCallsDisabledRequests.emplace(hash, id);

View file

@ -90,7 +90,7 @@ void BlockedPeers::block(not_null<PeerData*> peer) {
++_slice->total; ++_slice->total;
_changes.fire_copy(*_slice); _changes.fire_copy(*_slice);
} }
}).fail([=](const MTP::Error &error) { }).fail([=] {
_blockRequests.erase(peer); _blockRequests.erase(peer);
}).send(); }).send();
@ -128,7 +128,7 @@ void BlockedPeers::unblock(not_null<PeerData*> peer, Fn<void()> onDone) {
if (onDone) { if (onDone) {
onDone(); onDone();
} }
}).fail([=](const MTP::Error &error) { }).fail([=] {
_blockRequests.erase(peer); _blockRequests.erase(peer);
}).send(); }).send();
_blockRequests.emplace(peer, requestId); _blockRequests.emplace(peer, requestId);
@ -165,7 +165,7 @@ void BlockedPeers::request(int offset, Fn<void(BlockedPeers::Slice)> onDone) {
)).done([=](const MTPcontacts_Blocked &result) { )).done([=](const MTPcontacts_Blocked &result) {
_requestId = 0; _requestId = 0;
onDone(TLToSlice(result, _session->data())); onDone(TLToSlice(result, _session->data()));
}).fail([=](const MTP::Error &error) { }).fail([=] {
_requestId = 0; _requestId = 0;
}).send(); }).send();
} }

View file

@ -387,7 +387,7 @@ void ChatParticipants::requestLast(not_null<ChannelData*> channel) {
LOG(("API Error: " LOG(("API Error: "
"channels.channelParticipantsNotModified received!")); "channels.channelParticipantsNotModified received!"));
}); });
}).fail([this, channel](const MTP::Error &error) { }).fail([this, channel] {
_participantsRequests.remove(channel); _participantsRequests.remove(channel);
}).send(); }).send();
@ -416,7 +416,7 @@ void ChatParticipants::requestBots(not_null<ChannelData*> channel) {
LOG(("API Error: " LOG(("API Error: "
"channels.channelParticipantsNotModified received!")); "channels.channelParticipantsNotModified received!"));
}); });
}).fail([=](const MTP::Error &error) { }).fail([=] {
_botsRequests.remove(channel); _botsRequests.remove(channel);
}).send(); }).send();
@ -445,7 +445,7 @@ void ChatParticipants::requestAdmins(not_null<ChannelData*> channel) {
LOG(("API Error: " LOG(("API Error: "
"channels.channelParticipantsNotModified received!")); "channels.channelParticipantsNotModified received!"));
}); });
}).fail([=](const MTP::Error &error) { }).fail([=] {
_adminsRequests.remove(channel); _adminsRequests.remove(channel);
}).send(); }).send();
@ -638,7 +638,7 @@ void ChatParticipants::kick(
_kickRequests.remove(KickRequest(channel, participant)); _kickRequests.remove(KickRequest(channel, participant));
channel->applyEditBanned(participant, currentRights, rights); channel->applyEditBanned(participant, currentRights, rights);
}).fail([this, kick](const MTP::Error &error) { }).fail([this, kick] {
_kickRequests.remove(kick); _kickRequests.remove(kick);
}).send(); }).send();
@ -666,7 +666,7 @@ void ChatParticipants::unblock(
} else { } else {
channel->updateFullForced(); channel->updateFullForced();
} }
}).fail([=](const MTP::Error &error) { }).fail([=] {
_kickRequests.remove(kick); _kickRequests.remove(kick);
}).send(); }).send();

View file

@ -36,17 +36,17 @@ void CloudPassword::reload() {
} }
_stateChanges.fire_copy(*_state); _stateChanges.fire_copy(*_state);
}); });
}).fail([=](const MTP::Error &error) { }).fail([=] {
_requestId = 0; _requestId = 0;
}).send(); }).send();
} }
void CloudPassword::clearUnconfirmedPassword() { void CloudPassword::clearUnconfirmedPassword() {
_requestId = _api.request(MTPaccount_CancelPasswordEmail( _requestId = _api.request(MTPaccount_CancelPasswordEmail(
)).done([=](const MTPBool &result) { )).done([=] {
_requestId = 0; _requestId = 0;
reload(); reload();
}).fail([=](const MTP::Error &error) { }).fail([=] {
_requestId = 0; _requestId = 0;
reload(); reload();
}).send(); }).send();

View file

@ -33,7 +33,7 @@ void GlobalPrivacy::reload(Fn<void()> callback) {
for (const auto &callback : base::take(_callbacks)) { for (const auto &callback : base::take(_callbacks)) {
callback(); callback();
} }
}).fail([=](const MTP::Error &error) { }).fail([=] {
_requestId = 0; _requestId = 0;
for (const auto &callback : base::take(_callbacks)) { for (const auto &callback : base::take(_callbacks)) {
callback(); callback();
@ -86,7 +86,7 @@ void GlobalPrivacy::update(bool archiveAndMute) {
)).done([=](const MTPGlobalPrivacySettings &result) { )).done([=](const MTPGlobalPrivacySettings &result) {
_requestId = 0; _requestId = 0;
apply(result); apply(result);
}).fail([=](const MTP::Error &error) { }).fail([=] {
_requestId = 0; _requestId = 0;
}).send(); }).send();
_archiveAndMute = archiveAndMute; _archiveAndMute = archiveAndMute;

View file

@ -128,7 +128,7 @@ void InviteLinks::performCreate(
callback(link); callback(link);
} }
} }
}).fail([=](const MTP::Error &error) { }).fail([=] {
_createCallbacks.erase(peer); _createCallbacks.erase(peer);
}).send(); }).send();
} }
@ -313,7 +313,7 @@ void InviteLinks::performEdit(
prepend(peer, admin, data.vnew_invite()); prepend(peer, admin, data.vnew_invite());
} }
}); });
}).fail([=](const MTP::Error &error) { }).fail([=] {
_editCallbacks.erase(key); _editCallbacks.erase(key);
}).send(); }).send();
} }
@ -375,7 +375,7 @@ void InviteLinks::destroy(
.admin = admin, .admin = admin,
.was = key.link, .was = key.link,
}); });
}).fail([=](const MTP::Error &error) { }).fail([=] {
_deleteCallbacks.erase(key); _deleteCallbacks.erase(key);
}).send(); }).send();
} }
@ -405,7 +405,6 @@ void InviteLinks::destroyAllRevoked(
} }
} }
_allRevokedDestroyed.fire({ peer, admin }); _allRevokedDestroyed.fire({ peer, admin });
}).fail([=](const MTP::Error &error) {
}).send(); }).send();
} }
@ -446,7 +445,7 @@ void InviteLinks::requestMyLinks(not_null<PeerData*> peer) {
i->second.count = std::max(slice.count, int(existing.size())); i->second.count = std::max(slice.count, int(existing.size()));
} }
notify(peer); notify(peer);
}).fail([=](const MTP::Error &error) { }).fail([=] {
_firstSliceRequests.remove(peer); _firstSliceRequests.remove(peer);
}).send(); }).send();
_firstSliceRequests.emplace(peer, requestId); _firstSliceRequests.emplace(peer, requestId);
@ -507,7 +506,7 @@ void InviteLinks::processRequest(
done(); done();
} }
} }
}).fail([=](const MTP::Error &error) { }).fail([=] {
if (const auto callbacks = _processRequests.take({ peer, user })) { if (const auto callbacks = _processRequests.take({ peer, user })) {
if (const auto &fail = callbacks->fail) { if (const auto &fail = callbacks->fail) {
fail(); fail();
@ -608,7 +607,7 @@ void InviteLinks::requestJoinedFirstSlice(LinkKey key) {
_firstJoinedRequests.remove(key); _firstJoinedRequests.remove(key);
_firstJoined[key] = ParseJoinedByLinkSlice(key.peer, result); _firstJoined[key] = ParseJoinedByLinkSlice(key.peer, result);
_joinedFirstSliceLoaded.fire_copy(key); _joinedFirstSliceLoaded.fire_copy(key);
}).fail([=](const MTP::Error &error) { }).fail([=] {
_firstJoinedRequests.remove(key); _firstJoinedRequests.remove(key);
}).send(); }).send();
_firstJoinedRequests.emplace(key, requestId); _firstJoinedRequests.emplace(key, requestId);
@ -771,7 +770,7 @@ void InviteLinks::requestMoreLinks(
MTP_int(kPerPage) MTP_int(kPerPage)
)).done([=](const MTPmessages_ExportedChatInvites &result) { )).done([=](const MTPmessages_ExportedChatInvites &result) {
done(parseSlice(peer, result)); done(parseSlice(peer, result));
}).fail([=](const MTP::Error &error) { }).fail([=] {
done(Links()); done(Links());
}).send(); }).send();
} }

View file

@ -150,7 +150,7 @@ void Polls::sendVotes(
_pollVotesRequestIds.erase(itemId); _pollVotesRequestIds.erase(itemId);
hideSending(); hideSending();
_session->updates().applyUpdates(result); _session->updates().applyUpdates(result);
}).fail([=](const MTP::Error &error) { }).fail([=] {
_pollVotesRequestIds.erase(itemId); _pollVotesRequestIds.erase(itemId);
hideSending(); hideSending();
}).send(); }).send();
@ -179,7 +179,7 @@ void Polls::close(not_null<HistoryItem*> item) {
)).done([=](const MTPUpdates &result) { )).done([=](const MTPUpdates &result) {
_pollCloseRequestIds.erase(itemId); _pollCloseRequestIds.erase(itemId);
_session->updates().applyUpdates(result); _session->updates().applyUpdates(result);
}).fail([=](const MTP::Error &error) { }).fail([=] {
_pollCloseRequestIds.erase(itemId); _pollCloseRequestIds.erase(itemId);
}).send(); }).send();
_pollCloseRequestIds.emplace(itemId, requestId); _pollCloseRequestIds.emplace(itemId, requestId);
@ -196,7 +196,7 @@ void Polls::reloadResults(not_null<HistoryItem*> item) {
)).done([=](const MTPUpdates &result) { )).done([=](const MTPUpdates &result) {
_pollReloadRequestIds.erase(itemId); _pollReloadRequestIds.erase(itemId);
_session->updates().applyUpdates(result); _session->updates().applyUpdates(result);
}).fail([=](const MTP::Error &error) { }).fail([=] {
_pollReloadRequestIds.erase(itemId); _pollReloadRequestIds.erase(itemId);
}).send(); }).send();
_pollReloadRequestIds.emplace(itemId, requestId); _pollReloadRequestIds.emplace(itemId, requestId);

View file

@ -25,7 +25,7 @@ void SelfDestruct::reload() {
result.match([&](const MTPDaccountDaysTTL &data) { result.match([&](const MTPDaccountDaysTTL &data) {
_days = data.vdays().v; _days = data.vdays().v;
}); });
}).fail([=](const MTP::Error &error) { }).fail([=] {
_requestId = 0; _requestId = 0;
}).send(); }).send();
} }
@ -42,7 +42,7 @@ void SelfDestruct::update(int days) {
MTP_accountDaysTTL(MTP_int(days)) MTP_accountDaysTTL(MTP_int(days))
)).done([=](const MTPBool &result) { )).done([=](const MTPBool &result) {
_requestId = 0; _requestId = 0;
}).fail([=](const MTP::Error &result) { }).fail([=] {
_requestId = 0; _requestId = 0;
}).send(); }).send();
_days = days; _days = days;

View file

@ -36,7 +36,7 @@ void SensitiveContent::reload() {
_enabled = data.is_sensitive_enabled(); _enabled = data.is_sensitive_enabled();
_canChange = data.is_sensitive_can_change(); _canChange = data.is_sensitive_can_change();
}); });
}).fail([=](const MTP::Error &error) { }).fail([=] {
_requestId = 0; _requestId = 0;
}).send(); }).send();
} }
@ -63,7 +63,7 @@ void SensitiveContent::update(bool enabled) {
MTP_flags(enabled ? Flag::f_sensitive_enabled : Flag(0)) MTP_flags(enabled ? Flag::f_sensitive_enabled : Flag(0))
)).done([=](const MTPBool &result) { )).done([=](const MTPBool &result) {
_requestId = 0; _requestId = 0;
}).fail([=](const MTP::Error &error) { }).fail([=] {
_requestId = 0; _requestId = 0;
}).send(); }).send();
_enabled = enabled; _enabled = enabled;

View file

@ -117,7 +117,7 @@ std::optional<HistoryItem*> SingleMessageSearch::performLookupByChannel(
} else { } else {
fail(); fail();
} }
}).fail([=](const MTP::Error &error) { }).fail([=] {
fail(); fail();
}).send(); }).send();
@ -154,7 +154,7 @@ std::optional<HistoryItem*> SingleMessageSearch::performLookupById(
fail(); fail();
} }
}); });
}).fail([=](const MTP::Error &error) { }).fail([=] {
fail(); fail();
}).send(); }).send();
@ -198,7 +198,7 @@ std::optional<HistoryItem*> SingleMessageSearch::performLookupByUsername(
fail(); fail();
} }
}); });
}).fail([=](const MTP::Error &error) { }).fail([=] {
fail(); fail();
}).send(); }).send();

View file

@ -769,7 +769,7 @@ void Updates::channelRangeDifferenceSend(
)).done([=](const MTPupdates_ChannelDifference &result) { )).done([=](const MTPupdates_ChannelDifference &result) {
_rangeDifferenceRequests.remove(channel); _rangeDifferenceRequests.remove(channel);
channelRangeDifferenceDone(channel, range, result); channelRangeDifferenceDone(channel, range, result);
}).fail([=](const MTP::Error &error) { }).fail([=] {
_rangeDifferenceRequests.remove(channel); _rangeDifferenceRequests.remove(channel);
}).send(); }).send();
_rangeDifferenceRequests.emplace(channel, requestId); _rangeDifferenceRequests.emplace(channel, requestId);
@ -921,7 +921,7 @@ void Updates::updateOnline(crl::time lastNonIdleTime, bool gotOtherOffline) {
MTP_bool(!isOnline) MTP_bool(!isOnline)
)).done([=](const MTPBool &result) { )).done([=](const MTPBool &result) {
Core::App().quitPreventFinished(); Core::App().quitPreventFinished();
}).fail([=](const MTP::Error &error) { }).fail([=] {
Core::App().quitPreventFinished(); Core::App().quitPreventFinished();
}).send(); }).send();
} }

View file

@ -241,7 +241,7 @@ void UserPrivacy::save(
_privacySaveRequests.remove(keyTypeId); _privacySaveRequests.remove(keyTypeId);
apply(keyTypeId, data.vrules(), true); apply(keyTypeId, data.vrules(), true);
}); });
}).fail([=](const MTP::Error &error) { }).fail([=] {
_privacySaveRequests.remove(keyTypeId); _privacySaveRequests.remove(keyTypeId);
}).send(); }).send();
@ -277,7 +277,7 @@ void UserPrivacy::reload(Key key) {
_session->data().processChats(data.vchats()); _session->data().processChats(data.vchats());
pushPrivacy(key, data.vrules()); pushPrivacy(key, data.vrules());
}); });
}).fail([=](const MTP::Error &error) { }).fail([=] {
_privacyRequestIds.erase(key); _privacyRequestIds.erase(key);
}).send(); }).send();
_privacyRequestIds.emplace(key, requestId); _privacyRequestIds.emplace(key, requestId);

View file

@ -164,7 +164,7 @@ struct State {
peers.push_back(UserId(id)); peers.push_back(UserId(id));
} }
entry.list = std::move(peers); entry.list = std::move(peers);
}).fail([=](const MTP::Error &error) { }).fail([=] {
auto &entry = context->cache(item); auto &entry = context->cache(item);
entry.requestId = 0; entry.requestId = 0;
if (ListUnknown(entry.list.current(), item)) { if (ListUnknown(entry.list.current(), item)) {

View file

@ -226,7 +226,7 @@ void ApiWrap::refreshTopPromotion() {
)).done([=](const MTPhelp_PromoData &result) { )).done([=](const MTPhelp_PromoData &result) {
_topPromotionRequestId = 0; _topPromotionRequestId = 0;
topPromotionDone(result); topPromotionDone(result);
}).fail([=](const MTP::Error &error) { }).fail([=] {
_topPromotionRequestId = 0; _topPromotionRequestId = 0;
const auto now = base::unixtime::now(); const auto now = base::unixtime::now();
const auto next = _topPromotionNextRequestTime = now const auto next = _topPromotionNextRequestTime = now
@ -276,7 +276,7 @@ void ApiWrap::requestDeepLinkInfo(
if (result.type() == mtpc_help_deepLinkInfo) { if (result.type() == mtpc_help_deepLinkInfo) {
callback(result.c_help_deepLinkInfo()); callback(result.c_help_deepLinkInfo());
} }
}).fail([=](const MTP::Error &error) { }).fail([=] {
_deepLinkInfoRequestId = 0; _deepLinkInfoRequestId = 0;
}).send(); }).send();
} }
@ -323,7 +323,7 @@ void ApiWrap::requestTermsUpdate() {
} break; } break;
default: Unexpected("Type in requestTermsUpdate()."); default: Unexpected("Type in requestTermsUpdate().");
} }
}).fail([=](const MTP::Error &error) { }).fail([=] {
_termsUpdateRequestId = 0; _termsUpdateRequestId = 0;
_termsUpdateSendAt = crl::now() + kTermsUpdateTimeoutMin; _termsUpdateSendAt = crl::now() + kTermsUpdateTimeoutMin;
requestTermsUpdate(); requestTermsUpdate();
@ -455,7 +455,7 @@ void ApiWrap::toggleHistoryArchived(
if (isPinned) { if (isPinned) {
_session->data().notifyPinnedDialogsOrderUpdated(); _session->data().notifyPinnedDialogsOrderUpdated();
} }
}).fail([=](const MTP::Error &error) { }).fail([=] {
_historyArchivedRequests.remove(history); _historyArchivedRequests.remove(history);
}).send(); }).send();
_historyArchivedRequests.emplace(history, requestId, callback); _historyArchivedRequests.emplace(history, requestId, callback);
@ -736,7 +736,7 @@ void ApiWrap::requestContacts() {
} }
} }
_session->data().contactsLoaded() = true; _session->data().contactsLoaded() = true;
}).fail([=](const MTP::Error &error) { }).fail([=] {
_contactsRequestId = 0; _contactsRequestId = 0;
}).send(); }).send();
} }
@ -810,7 +810,7 @@ void ApiWrap::requestMoreDialogs(Data::Folder *folder) {
} }
requestMoreDialogsIfNeeded(); requestMoreDialogsIfNeeded();
_session->data().chatsListChanged(folder); _session->data().chatsListChanged(folder);
}).fail([=](const MTP::Error &error) { }).fail([=] {
dialogsLoadState(folder)->requestId = 0; dialogsLoadState(folder)->requestId = 0;
}).send(); }).send();
@ -955,7 +955,7 @@ void ApiWrap::requestPinnedDialogs(Data::Folder *folder) {
_session->data().chatsListChanged(folder); _session->data().chatsListChanged(folder);
_session->data().notifyPinnedDialogsOrderUpdated(); _session->data().notifyPinnedDialogsOrderUpdated();
}); });
}).fail([=](const MTP::Error &error) { }).fail([=] {
finalize(); finalize();
}).send(); }).send();
} }
@ -1138,7 +1138,7 @@ void ApiWrap::requestPeer(not_null<PeerData*> peer) {
} }
const auto requestId = [&] { const auto requestId = [&] {
const auto failHandler = [=](const MTP::Error &error) { const auto failHandler = [=] {
_peerRequests.remove(peer); _peerRequests.remove(peer);
}; };
const auto chatHandler = [=](const MTPmessages_Chats &result) { const auto chatHandler = [=](const MTPmessages_Chats &result) {
@ -1183,7 +1183,7 @@ void ApiWrap::requestPeerSettings(not_null<PeerData*> peer) {
peer->setSettings(data.vsettings()); peer->setSettings(data.vsettings());
_requestedPeerSettings.erase(peer); _requestedPeerSettings.erase(peer);
}); });
}).fail([=](const MTP::Error &error) { }).fail([=] {
_requestedPeerSettings.erase(peer); _requestedPeerSettings.erase(peer);
}).send(); }).send();
} }
@ -1437,7 +1437,7 @@ void ApiWrap::requestStickerSets() {
MTP_int(0) // hash MTP_int(0) // hash
)).done([=, setId = i.key()](const MTPmessages_StickerSet &result) { )).done([=, setId = i.key()](const MTPmessages_StickerSet &result) {
gotStickerSet(setId, result); gotStickerSet(setId, result);
}).fail([=, setId = i.key()](const MTP::Error &error) { }).fail([=, setId = i.key()] {
_stickerSetRequests.remove(setId); _stickerSetRequests.remove(setId);
}).afterDelay(waitMs).send(); }).afterDelay(waitMs).send();
} }
@ -1480,7 +1480,7 @@ void ApiWrap::saveStickerSets(
MTP_vector<MTPlong>(mtpOrder) MTP_vector<MTPlong>(mtpOrder)
)).done([=](const MTPBool &result) { )).done([=](const MTPBool &result) {
reorderRequestId() = 0; reorderRequestId() = 0;
}).fail([=](const MTP::Error &error) { }).fail([=] {
reorderRequestId() = 0; reorderRequestId() = 0;
if (setsMasks) { if (setsMasks) {
_session->data().stickers().setLastMasksUpdate(0); _session->data().stickers().setLastMasksUpdate(0);
@ -1553,7 +1553,7 @@ void ApiWrap::saveStickerSets(
MTP_flags(flags) MTP_flags(flags)
)).done([=](const MTPBool &result) { )).done([=](const MTPBool &result) {
finish(); finish();
}).fail([=](const MTP::Error &error) { }).fail([=] {
finish(); finish();
}).send(); }).send();
continue; continue;
@ -1755,7 +1755,7 @@ void ApiWrap::leaveChannel(not_null<ChannelData*> channel) {
)).done([=](const MTPUpdates &result) { )).done([=](const MTPUpdates &result) {
_channelAmInRequests.remove(channel); _channelAmInRequests.remove(channel);
applyUpdates(result); applyUpdates(result);
}).fail([=](const MTP::Error &error) { }).fail([=] {
_channelAmInRequests.remove(channel); _channelAmInRequests.remove(channel);
}).send(); }).send();
@ -1797,7 +1797,7 @@ void ApiWrap::requestNotifySettings(const MTPInputNotifyPeer &peer) {
)).done([=](const MTPPeerNotifySettings &result) { )).done([=](const MTPPeerNotifySettings &result) {
applyNotifySettings(peer, result); applyNotifySettings(peer, result);
_notifySettingRequests.erase(key); _notifySettingRequests.erase(key);
}).fail([=](const MTP::Error &error) { }).fail([=] {
applyNotifySettings( applyNotifySettings(
peer, peer,
MTP_peerNotifySettings( MTP_peerNotifySettings(
@ -1879,7 +1879,7 @@ void ApiWrap::updatePrivacyLastSeens() {
} }
} }
} }
}).fail([this](const MTP::Error &error) { }).fail([this] {
_contactsStatusesRequestId = 0; _contactsStatusesRequestId = 0;
}).send(); }).send();
} }
@ -1913,7 +1913,7 @@ void ApiWrap::deleteConversation(not_null<PeerData*> peer, bool revoke) {
)).done([=](const MTPUpdates &result) { )).done([=](const MTPUpdates &result) {
applyUpdates(result); applyUpdates(result);
deleteHistory(peer, false, revoke); deleteHistory(peer, false, revoke);
}).fail([=](const MTP::Error &error) { }).fail([=] {
deleteHistory(peer, false, revoke); deleteHistory(peer, false, revoke);
}).send(); }).send();
} else { } else {
@ -2337,7 +2337,7 @@ void ApiWrap::requestFileReference(
for (auto &handler : handlers) { for (auto &handler : handlers) {
handler(parsed); handler(parsed);
} }
}).fail([=](const MTP::Error &error) { }).fail([=] {
const auto i = _fileReferenceHandlers.find(origin); const auto i = _fileReferenceHandlers.find(origin);
Assert(i != end(_fileReferenceHandlers)); Assert(i != end(_fileReferenceHandlers));
auto handlers = std::move(i->second); auto handlers = std::move(i->second);
@ -2590,7 +2590,7 @@ void ApiWrap::requestStickers(TimeId now) {
}; };
_stickersUpdateRequest = request(MTPmessages_GetAllStickers( _stickersUpdateRequest = request(MTPmessages_GetAllStickers(
MTP_long(Api::CountStickersHash(_session, true)) MTP_long(Api::CountStickersHash(_session, true))
)).done(done).fail([=](const MTP::Error &error) { )).done(done).fail([=] {
LOG(("App Fail: Failed to get stickers!")); LOG(("App Fail: Failed to get stickers!"));
done(MTP_messages_allStickersNotModified()); done(MTP_messages_allStickersNotModified());
}).send(); }).send();
@ -2614,7 +2614,7 @@ void ApiWrap::requestMasks(TimeId now) {
}; };
_masksUpdateRequest = request(MTPmessages_GetMaskStickers( _masksUpdateRequest = request(MTPmessages_GetMaskStickers(
MTP_long(Api::CountMasksHash(_session, true)) MTP_long(Api::CountMasksHash(_session, true))
)).done(done).fail([=](const MTP::Error &error) { )).done(done).fail([=] {
LOG(("App Fail: Failed to get masks!")); LOG(("App Fail: Failed to get masks!"));
done(MTP_messages_allStickersNotModified()); done(MTP_messages_allStickersNotModified());
}).send(); }).send();
@ -2674,7 +2674,7 @@ void ApiWrap::requestRecentStickersWithHash(uint64 hash, bool attached) {
} return; } return;
default: Unexpected("Type in ApiWrap::recentStickersDone()"); default: Unexpected("Type in ApiWrap::recentStickersDone()");
} }
}).fail([=](const MTP::Error &error) { }).fail([=] {
finish(); finish();
LOG(("App Fail: Failed to get recent stickers!")); LOG(("App Fail: Failed to get recent stickers!"));
@ -2705,7 +2705,7 @@ void ApiWrap::requestFavedStickers(TimeId now) {
} return; } return;
default: Unexpected("Type in ApiWrap::favedStickersDone()"); default: Unexpected("Type in ApiWrap::favedStickersDone()");
} }
}).fail([=](const MTP::Error &error) { }).fail([=] {
_session->data().stickers().setLastFavedUpdate(crl::now()); _session->data().stickers().setLastFavedUpdate(crl::now());
_favedStickersUpdateRequest = 0; _favedStickersUpdateRequest = 0;
@ -2735,7 +2735,7 @@ void ApiWrap::requestFeaturedStickers(TimeId now) {
} return; } return;
default: Unexpected("Type in ApiWrap::featuredStickersDone()"); default: Unexpected("Type in ApiWrap::featuredStickersDone()");
} }
}).fail([=](const MTP::Error &error) { }).fail([=] {
_session->data().stickers().setLastFeaturedUpdate(crl::now()); _session->data().stickers().setLastFeaturedUpdate(crl::now());
_featuredStickersUpdateRequest = 0; _featuredStickersUpdateRequest = 0;
@ -2764,7 +2764,7 @@ void ApiWrap::requestSavedGifs(TimeId now) {
} return; } return;
default: Unexpected("Type in ApiWrap::savedGifsDone()"); default: Unexpected("Type in ApiWrap::savedGifsDone()");
} }
}).fail([=](const MTP::Error &error) { }).fail([=] {
_session->data().stickers().setLastSavedGifsUpdate(crl::now()); _session->data().stickers().setLastSavedGifsUpdate(crl::now());
_savedGifsUpdateRequest = 0; _savedGifsUpdateRequest = 0;
@ -2923,7 +2923,7 @@ void ApiWrap::preloadEnoughUnreadMentions(not_null<History*> history) {
auto requestId = request(MTPmessages_GetUnreadMentions(history->peer->input, MTP_int(offsetId), MTP_int(addOffset), MTP_int(limit), MTP_int(maxId), MTP_int(minId))).done([this, history](const MTPmessages_Messages &result) { auto requestId = request(MTPmessages_GetUnreadMentions(history->peer->input, MTP_int(offsetId), MTP_int(addOffset), MTP_int(limit), MTP_int(maxId), MTP_int(minId))).done([this, history](const MTPmessages_Messages &result) {
_unreadMentionsRequests.remove(history); _unreadMentionsRequests.remove(history);
history->addUnreadMentionsSlice(result); history->addUnreadMentionsSlice(result);
}).fail([this, history](const MTP::Error &error) { }).fail([this, history] {
_unreadMentionsRequests.remove(history); _unreadMentionsRequests.remove(history);
}).send(); }).send();
_unreadMentionsRequests.emplace(history, requestId); _unreadMentionsRequests.emplace(history, requestId);
@ -2982,7 +2982,7 @@ void ApiWrap::requestSharedMedia(
_sharedMediaRequests.remove(key); _sharedMediaRequests.remove(key);
sharedMediaDone(peer, type, messageId, slice, result); sharedMediaDone(peer, type, messageId, slice, result);
finish(); finish();
}).fail([=](const MTP::Error &error) { }).fail([=] {
_sharedMediaRequests.remove(key); _sharedMediaRequests.remove(key);
finish(); finish();
}).send(); }).send();
@ -3031,7 +3031,7 @@ void ApiWrap::requestUserPhotos(
)).done([this, user, afterId](const MTPphotos_Photos &result) { )).done([this, user, afterId](const MTPphotos_Photos &result) {
_userPhotosRequests.remove(user); _userPhotosRequests.remove(user);
userPhotosDone(user, afterId, result); userPhotosDone(user, afterId, result);
}).fail([this, user](const MTP::Error &error) { }).fail([this, user] {
_userPhotosRequests.remove(user); _userPhotosRequests.remove(user);
}).send(); }).send();
_userPhotosRequests.emplace(user, requestId); _userPhotosRequests.emplace(user, requestId);
@ -3823,7 +3823,7 @@ void ApiWrap::uploadAlbumMedia(
sendAlbumWithUploaded(item, groupId, media); sendAlbumWithUploaded(item, groupId, media);
} break; } break;
} }
}).fail([=](const MTP::Error &error) { }).fail([=] {
failed(); failed();
}).send(); }).send();
} }
@ -4034,7 +4034,7 @@ void ApiWrap::reloadContactSignupSilent() {
const auto silent = mtpIsTrue(result); const auto silent = mtpIsTrue(result);
_contactSignupSilent = silent; _contactSignupSilent = silent;
_contactSignupSilentChanges.fire_copy(silent); _contactSignupSilentChanges.fire_copy(silent);
}).fail([=](const MTP::Error &error) { }).fail([=] {
_contactSignupSilentRequestId = 0; _contactSignupSilentRequestId = 0;
}).send(); }).send();
_contactSignupSilentRequestId = requestId; _contactSignupSilentRequestId = requestId;
@ -4060,7 +4060,7 @@ void ApiWrap::saveContactSignupSilent(bool silent) {
_contactSignupSilentRequestId = 0; _contactSignupSilentRequestId = 0;
_contactSignupSilent = silent; _contactSignupSilent = silent;
_contactSignupSilentChanges.fire_copy(silent); _contactSignupSilentChanges.fire_copy(silent);
}).fail([=](const MTP::Error &error) { }).fail([=] {
_contactSignupSilentRequestId = 0; _contactSignupSilentRequestId = 0;
}).send(); }).send();
_contactSignupSilentRequestId = requestId; _contactSignupSilentRequestId = requestId;
@ -4085,7 +4085,7 @@ void ApiWrap::saveSelfBio(const QString &text) {
_session->data().processUser(result); _session->data().processUser(result);
_session->user()->setAbout(_bio.requestedText); _session->user()->setAbout(_bio.requestedText);
}).fail([=](const MTP::Error &error) { }).fail([=] {
_bio.requestId = 0; _bio.requestId = 0;
}).send(); }).send();
} }

View file

@ -478,10 +478,6 @@ void PasscodeBox::closeReplacedBy() {
} }
} }
void PasscodeBox::setPasswordFail(const MTP::Error &error) {
setPasswordFail(error.type());
}
void PasscodeBox::setPasswordFail(const QString &type) { void PasscodeBox::setPasswordFail(const QString &type) {
if (MTP::IsFloodError(type)) { if (MTP::IsFloodError(type)) {
closeReplacedBy(); closeReplacedBy();
@ -533,7 +529,7 @@ void PasscodeBox::setPasswordFail(
validateEmail(email, codeLength, newPasswordBytes); validateEmail(email, codeLength, newPasswordBytes);
} else { } else {
setPasswordFail(error); setPasswordFail(error.type());
} }
} }
@ -582,7 +578,7 @@ void PasscodeBox::validateEmail(
)).done([=](const MTPBool &result) { )).done([=](const MTPBool &result) {
_setRequest = 0; _setRequest = 0;
resent->fire(tr::lng_cloud_password_resent(tr::now)); resent->fire(tr::lng_cloud_password_resent(tr::now));
}).fail([=](const MTP::Error &error) { }).fail([=] {
_setRequest = 0; _setRequest = 0;
errors->fire(Lang::Hard::ServerError()); errors->fire(Lang::Hard::ServerError());
}).send(); }).send();
@ -942,7 +938,7 @@ void PasscodeBox::changeCloudPassword(
}); });
} }
}).fail([=](const MTP::Error &error) { }).fail([=](const MTP::Error &error) {
setPasswordFail(error); setPasswordFail(error.type());
}).handleFloodErrors().send(); }).handleFloodErrors().send();
} }
@ -1419,7 +1415,7 @@ RecoveryEmailValidation ConfirmRecoveryEmail(
)).done([=](const MTPBool &result) { )).done([=](const MTPBool &result) {
*requestId = 0; *requestId = 0;
resent->fire(tr::lng_cloud_password_resent(tr::now)); resent->fire(tr::lng_cloud_password_resent(tr::now));
}).fail([=](const MTP::Error &error) { }).fail([=] {
*requestId = 0; *requestId = 0;
errors->fire(Lang::Hard::ServerError()); errors->fire(Lang::Hard::ServerError());
}).send(); }).send();

View file

@ -98,7 +98,6 @@ private:
void recoverPasswordDone( void recoverPasswordDone(
const QByteArray &newPasswordBytes, const QByteArray &newPasswordBytes,
const MTPauth_Authorization &result); const MTPauth_Authorization &result);
void setPasswordFail(const MTP::Error &error);
void setPasswordFail(const QString &type); void setPasswordFail(const QString &type);
void setPasswordFail( void setPasswordFail(
const QByteArray &newPasswordBytes, const QByteArray &newPasswordBytes,

View file

@ -490,7 +490,7 @@ void AddSpecialBoxController::loadMoreRows() {
setDescriptionText(tr::lng_blocked_list_not_found(tr::now)); setDescriptionText(tr::lng_blocked_list_not_found(tr::now));
} }
delegate()->peerListRefreshRows(); delegate()->peerListRefreshRows();
}).fail([this](const MTP::Error &error) { }).fail([this] {
_loadRequestId = 0; _loadRequestId = 0;
}).send(); }).send();
} }
@ -530,7 +530,7 @@ bool AddSpecialBoxController::checkInfoLoaded(
Api::ChatParticipant(data.vparticipant(), channel)); Api::ChatParticipant(data.vparticipant(), channel));
}); });
callback(); callback();
}).fail([=](const MTP::Error &error) { }).fail([=] {
_additional.setExternal(participant); _additional.setExternal(participant);
callback(); callback();
}).send(); }).send();

View file

@ -73,7 +73,6 @@ void SendRequest(
lt_user, lt_user,
first)); first));
} }
}).fail([=](const MTP::Error &error) {
}).send(); }).send();
} }

View file

@ -61,7 +61,7 @@ void RemoveAdmin(
if (onDone) { if (onDone) {
onDone(); onDone();
} }
}).fail([=](const MTP::Error &error) { }).fail([=] {
if (onFail) { if (onFail) {
onFail(); onFail();
} }
@ -168,7 +168,7 @@ void SaveChannelRestriction(
if (onDone) { if (onDone) {
onDone(); onDone();
} }
}).fail([=](const MTP::Error &error) { }).fail([=] {
if (onFail) { if (onFail) {
onFail(); onFail();
} }
@ -189,7 +189,7 @@ void SaveChatParticipantKick(
if (onDone) { if (onDone) {
onDone(); onDone();
} }
}).fail([=](const MTP::Error &error) { }).fail([=] {
if (onFail) { if (onFail) {
onFail(); onFail();
} }
@ -1418,7 +1418,7 @@ void ParticipantsBoxController::loadMoreRows() {
_onlineSorter->sort(); _onlineSorter->sort();
} }
delegate()->peerListRefreshRows(); delegate()->peerListRefreshRows();
}).fail([this](const MTP::Error &error) { }).fail([this] {
_loadRequestId = 0; _loadRequestId = 0;
}).send(); }).send();
} }

View file

@ -242,7 +242,7 @@ void ShowEditPermissions(
const auto api = &peer->session().api(); const auto api = &peer->session().api();
api->migrateChat(chat, [=](not_null<ChannelData*> channel) { api->migrateChat(chat, [=](not_null<ChannelData*> channel) {
save(channel, result); save(channel, result);
}, [=](const MTP::Error &error) { }, [=](const MTP::Error &) {
*saving = false; *saving = false;
}); });
}, box->lifetime()); }, box->lifetime());
@ -685,7 +685,7 @@ void Controller::showEditLinkedChatBox() {
std::move(chats), std::move(chats),
callback), callback),
Ui::LayerOption::KeepOther); Ui::LayerOption::KeepOther);
}).fail([=](const MTP::Error &error) { }).fail([=] {
_linkedChatsRequestId = 0; _linkedChatsRequestId = 0;
}).send(); }).send();
} }
@ -1361,7 +1361,7 @@ void Controller::saveLinkedChat() {
)).done([=](const MTPBool &result) { )).done([=](const MTPBool &result) {
channel->setLinkedChat(*_savingData.linkedChat); channel->setLinkedChat(*_savingData.linkedChat);
continueSave(); continueSave();
}).fail([=](const MTP::Error &error) { }).fail([=] {
cancelSave(); cancelSave();
}).send(); }).send();
} }

View file

@ -689,7 +689,7 @@ void Controller::loadMoreRows() {
auto slice = Api::ParseJoinedByLinkSlice(_peer, result); auto slice = Api::ParseJoinedByLinkSlice(_peer, result);
_allLoaded = slice.users.empty(); _allLoaded = slice.users.empty();
appendSlice(slice); appendSlice(slice);
}).fail([=](const MTP::Error &error) { }).fail([=] {
_requestId = 0; _requestId = 0;
_allLoaded = true; _allLoaded = true;
}).send(); }).send();

View file

@ -327,7 +327,7 @@ Fn<void()> AboutGigagroupCallback(not_null<ChannelData*> channel) {
channel->session().api().applyUpdates(result); channel->session().api().applyUpdates(result);
Ui::hideSettingsAndLayer(); Ui::hideSettingsAndLayer();
Ui::Toast::Show(tr::lng_gigagroup_done(tr::now)); Ui::Toast::Show(tr::lng_gigagroup_done(tr::now));
}).fail([=](const MTP::Error &error) { }).fail([=] {
*converting = false; *converting = false;
}).send(); }).send();
}; };

View file

@ -340,7 +340,7 @@ void RequestsBoxController::loadMoreRows() {
refreshDescription(); refreshDescription();
} }
delegate()->peerListRefreshRows(); delegate()->peerListRefreshRows();
}).fail([=](const MTP::Error &error) { }).fail([=] {
_loadRequestId = 0; _loadRequestId = 0;
_allLoaded = true; _allLoaded = true;
}).send(); }).send();

View file

@ -123,7 +123,7 @@ void PinMessageBox::pinMessage() {
)).done([=](const MTPUpdates &result) { )).done([=](const MTPUpdates &result) {
_peer->session().api().applyUpdates(result); _peer->session().api().applyUpdates(result);
Ui::hideLayer(); Ui::hideLayer();
}).fail([=](const MTP::Error &error) { }).fail([=] {
Ui::hideLayer(); Ui::hideLayer();
}).send(); }).send();
} }

View file

@ -371,7 +371,7 @@ StickerSetBox::Inner::Inner(
MTP_int(0) // hash MTP_int(0) // hash
)).done([=](const MTPmessages_StickerSet &result) { )).done([=](const MTPmessages_StickerSet &result) {
gotSet(result); gotSet(result);
}).fail([=](const MTP::Error &error) { }).fail([=] {
_loaded = true; _loaded = true;
_errors.fire(Error::NotFound); _errors.fire(Error::NotFound);
}).send(); }).send();
@ -934,7 +934,7 @@ void StickerSetBox::Inner::install() {
MTP_bool(false) MTP_bool(false)
)).done([=](const MTPmessages_StickerSetInstallResult &result) { )).done([=](const MTPmessages_StickerSetInstallResult &result) {
installDone(result); installDone(result);
}).fail([=](const MTP::Error &error) { }).fail([=] {
_errors.fire(Error::NotFound); _errors.fire(Error::NotFound);
}).send(); }).send();
} }
@ -947,7 +947,7 @@ void StickerSetBox::Inner::archiveStickers() {
if (result.type() == mtpc_messages_stickerSetInstallResultSuccess) { if (result.type() == mtpc_messages_stickerSetInstallResultSuccess) {
_setArchived.fire_copy(_setId); _setArchived.fire_copy(_setId);
} }
}).fail([](const MTP::Error &error) { }).fail([] {
Ui::Toast::Show(Lang::Hard::ServerError()); Ui::Toast::Show(Lang::Hard::ServerError());
}).send(); }).send();
} }

View file

@ -1897,7 +1897,7 @@ void StickersBox::Inner::handleMegagroupSetAddressChange() {
}, [](const MTPDmessages_stickerSetNotModified &) { }, [](const MTPDmessages_stickerSetNotModified &) {
LOG(("API Error: Unexpected messages.stickerSetNotModified.")); LOG(("API Error: Unexpected messages.stickerSetNotModified."));
}); });
}).fail([=](const MTP::Error &error) { }).fail([=] {
_megagroupSetRequestId = 0; _megagroupSetRequestId = 0;
setMegagroupSelectedSet({}); setMegagroupSelectedSet({});
}).send(); }).send();

View file

@ -67,7 +67,7 @@ void UrlAuthBox::Activate(
Request(data, item, row, column); Request(data, item, row, column);
} }
}); });
}).fail([=](const MTP::Error &error) { }).fail([=] {
const auto button = HistoryMessageMarkupButton::Get( const auto button = HistoryMessageMarkupButton::Get(
&session->data(), &session->data(),
itemId, itemId,
@ -105,7 +105,7 @@ void UrlAuthBox::Activate(
}, [&](const MTPDurlAuthResultRequest &data) { }, [&](const MTPDurlAuthResultRequest &data) {
Request(data, session, url, context); Request(data, session, url, context);
}); });
}).fail([=](const MTP::Error &error) { }).fail([=] {
HiddenUrlClickHandler::Open(url, context); HiddenUrlClickHandler::Open(url, context);
}).send(); }).send();
} }
@ -165,7 +165,7 @@ void UrlAuthBox::Request(
return url; return url;
}); });
finishWithUrl(to); finishWithUrl(to);
}).fail([=](const MTP::Error &error) { }).fail([=] {
finishWithUrl(url); finishWithUrl(url);
}).send(); }).send();
} }
@ -216,7 +216,7 @@ void UrlAuthBox::Request(
return url; return url;
}); });
finishWithUrl(to); finishWithUrl(to);
}).fail([=](const MTP::Error &error) { }).fail([=] {
finishWithUrl(url); finishWithUrl(url);
}).send(); }).send();
} }

View file

@ -344,7 +344,7 @@ void BoxController::loadMoreRows() {
} break; } break;
default: Unexpected("Type of messages.Messages (Calls::BoxController::preloadRows)"); default: Unexpected("Type of messages.Messages (Calls::BoxController::preloadRows)");
} }
}).fail([this](const MTP::Error &error) { }).fail([this] {
_loadRequestId = 0; _loadRequestId = 0;
}).send(); }).send();
} }

View file

@ -1209,7 +1209,7 @@ void Call::finish(FinishType type, const MTPPhoneCallDiscardReason &reason) {
// updates being handled, but in a guarded way. // updates being handled, but in a guarded way.
crl::on_main(weak, [=] { setState(finalState); }); crl::on_main(weak, [=] { setState(finalState); });
session->api().applyUpdates(result); session->api().applyUpdates(result);
}).fail(crl::guard(weak, [this, finalState](const MTP::Error &error) { }).fail(crl::guard(weak, [this, finalState] {
setState(finalState); setState(finalState);
})).send(); })).send();
} }

View file

@ -332,7 +332,7 @@ void Instance::refreshDhConfig() {
} else { } else {
_delegate->callFailed(call); _delegate->callFailed(call);
} }
}).fail([=](const MTP::Error &error) { }).fail([=] {
const auto call = weak.get(); const auto call = weak.get();
if (!call) { if (!call) {
return; return;
@ -391,7 +391,7 @@ void Instance::refreshServerConfig(not_null<Main::Session*> session) {
const auto &json = result.c_dataJSON().vdata().v; const auto &json = result.c_dataJSON().vdata().v;
UpdateConfig(std::string(json.data(), json.size())); UpdateConfig(std::string(json.data(), json.size()));
}).fail([=](const MTP::Error &error) { }).fail([=] {
_serverConfigRequestSession = nullptr; _serverConfigRequestSession = nullptr;
}).send(); }).send();
} }

View file

@ -467,7 +467,7 @@ void ChooseJoinAsProcess::start(
_request->box = box.data(); _request->box = box.data();
_request->showBox(std::move(box)); _request->showBox(std::move(box));
}).fail([=](const MTP::Error &error) { }).fail([=] {
finish({ finish({
.peer = _request->peer, .peer = _request->peer,
.joinAs = _request->peer->session().user(), .joinAs = _request->peer->session().user(),

View file

@ -1604,7 +1604,7 @@ void GroupCall::discard() {
// updates being handled, but in a guarded way. // updates being handled, but in a guarded way.
crl::on_main(this, [=] { hangup(); }); crl::on_main(this, [=] { hangup(); });
_peer->session().api().applyUpdates(result); _peer->session().api().applyUpdates(result);
}).fail([=](const MTP::Error &error) { }).fail([=] {
hangup(); hangup();
}).send(); }).send();
} }
@ -1672,7 +1672,7 @@ void GroupCall::leave() {
// updates being handled, but in a guarded way. // updates being handled, but in a guarded way.
crl::on_main(weak, [=] { setState(finalState); }); crl::on_main(weak, [=] { setState(finalState); });
session->api().applyUpdates(result); session->api().applyUpdates(result);
}).fail(crl::guard(weak, [=](const MTP::Error &error) { }).fail(crl::guard(weak, [=] {
setState(finalState); setState(finalState);
})).send(); })).send();
} }
@ -2225,7 +2225,6 @@ void GroupCall::changeTitle(const QString &title) {
)).done([=](const MTPUpdates &result) { )).done([=](const MTPUpdates &result) {
_peer->session().api().applyUpdates(result); _peer->session().api().applyUpdates(result);
_titleChanged.fire({}); _titleChanged.fire({});
}).fail([=](const MTP::Error &error) {
}).send(); }).send();
} }
@ -2258,7 +2257,7 @@ void GroupCall::toggleRecording(
)).done([=](const MTPUpdates &result) { )).done([=](const MTPUpdates &result) {
_peer->session().api().applyUpdates(result); _peer->session().api().applyUpdates(result);
_recordingStoppedByMe = false; _recordingStoppedByMe = false;
}).fail([=](const MTP::Error &error) { }).fail([=] {
_recordingStoppedByMe = false; _recordingStoppedByMe = false;
}).send(); }).send();
} }

View file

@ -400,7 +400,7 @@ void EmojiKeywords::LangPack::refresh() {
_requestId = 0; _requestId = 0;
_lastRefreshTime = crl::now(); _lastRefreshTime = crl::now();
applyDifference(result); applyDifference(result);
}).fail([=](const MTP::Error &error) { }).fail([=] {
_requestId = 0; _requestId = 0;
_lastRefreshTime = crl::now(); _lastRefreshTime = crl::now();
}).send(); }).send();
@ -670,7 +670,7 @@ void EmojiKeywords::refreshRemoteList() {
}); });
}) | ranges::to_vector); }) | ranges::to_vector);
_langsRequestId = 0; _langsRequestId = 0;
}).fail([=](const MTP::Error &error) { }).fail([=] {
_langsRequestId = 0; _langsRequestId = 0;
}).send(); }).send();
} }

View file

@ -854,7 +854,7 @@ void GifsListWidget::sendInlineRequest() {
MTP_string(nextOffset) MTP_string(nextOffset)
)).done([this](const MTPmessages_BotResults &result) { )).done([this](const MTPmessages_BotResults &result) {
inlineResultsDone(result); inlineResultsDone(result);
}).fail([this](const MTP::Error &error) { }).fail([this] {
// show error? // show error?
_footer->setLoading(false); _footer->setLoading(false);
_inlineRequestId = 0; _inlineRequestId = 0;

View file

@ -160,7 +160,7 @@ void SetupUnreadMentionsMenu(
)).done([=](const MTPmessages_AffectedHistory &result) { )).done([=](const MTPmessages_AffectedHistory &result) {
state->sentForPeers.remove(peer); state->sentForPeers.remove(peer);
peer->session().api().applyAffectedHistory(peer, result); peer->session().api().applyAffectedHistory(peer, result);
}).fail([=](const MTP::Error &error) { }).fail([=] {
state->sentForPeers.remove(peer); state->sentForPeers.remove(peer);
}).send(); }).send();
}); });

View file

@ -55,7 +55,7 @@ void DicePack::load() {
}, [](const MTPDmessages_stickerSetNotModified &) { }, [](const MTPDmessages_stickerSetNotModified &) {
LOG(("API Error: Unexpected messages.stickerSetNotModified.")); LOG(("API Error: Unexpected messages.stickerSetNotModified."));
}); });
}).fail([=](const MTP::Error &error) { }).fail([=] {
_requestId = 0; _requestId = 0;
}).send(); }).send();
} }

View file

@ -237,7 +237,7 @@ void EmojiPack::refreshAnimations() {
}, [](const MTPDmessages_stickerSetNotModified &) { }, [](const MTPDmessages_stickerSetNotModified &) {
LOG(("API Error: Unexpected messages.stickerSetNotModified.")); LOG(("API Error: Unexpected messages.stickerSetNotModified."));
}); });
}).fail([=](const MTP::Error &error) { }).fail([=] {
_animationsRequestId = 0; _animationsRequestId = 0;
refreshDelayed(); refreshDelayed();
}).send(); }).send();

View file

@ -1106,7 +1106,6 @@ void StickersListWidget::preloadMoreOfficial() {
}); });
resizeToWidth(width()); resizeToWidth(width());
update(); update();
}).fail([=](const MTP::Error &error) {
}).send(); }).send();
} }
@ -1276,7 +1275,7 @@ void StickersListWidget::sendSearchRequest() {
MTP_long(hash) MTP_long(hash)
)).done([=](const MTPmessages_FoundStickerSets &result) { )).done([=](const MTPmessages_FoundStickerSets &result) {
searchResultsDone(result); searchResultsDone(result);
}).fail([=](const MTP::Error &error) { }).fail([=] {
// show error? // show error?
_footer->setLoading(false); _footer->setLoading(false);
_searchRequestId = 0; _searchRequestId = 0;
@ -3149,7 +3148,7 @@ void StickersListWidget::sendInstallRequest(
session().data().stickers().applyArchivedResult( session().data().stickers().applyArchivedResult(
result.c_messages_stickerSetInstallResultArchive()); result.c_messages_stickerSetInstallResultArchive());
} }
}).fail([=](const MTP::Error &error) { }).fail([=] {
notInstalledLocally(setId); notInstalledLocally(setId);
session().data().stickers().undoInstallLocally(setId); session().data().stickers().undoInstallLocally(setId);
}).send(); }).send();

View file

@ -256,7 +256,7 @@ void ChatFilters::load(bool force) {
)).done([=](const MTPVector<MTPDialogFilter> &result) { )).done([=](const MTPVector<MTPDialogFilter> &result) {
received(result.v); received(result.v);
_loadRequestId = 0; _loadRequestId = 0;
}).fail([=](const MTP::Error &error) { }).fail([=] {
_loadRequestId = 0; _loadRequestId = 0;
}).send(); }).send();
} }
@ -555,7 +555,7 @@ bool ChatFilters::loadNextExceptions(bool chatsListLoaded) {
_exceptionsLoadRequestId = 0; _exceptionsLoadRequestId = 0;
_owner->session().data().histories().applyPeerDialogs(result); _owner->session().data().histories().applyPeerDialogs(result);
_owner->session().api().requestMoreDialogsIfNeeded(); _owner->session().api().requestMoreDialogsIfNeeded();
}).fail([=](const MTP::Error &error) { }).fail([=] {
_exceptionsLoadRequestId = 0; _exceptionsLoadRequestId = 0;
_owner->session().api().requestMoreDialogsIfNeeded(); _owner->session().api().requestMoreDialogsIfNeeded();
}).send(); }).send();
@ -594,7 +594,7 @@ void ChatFilters::requestSuggested() {
}) | ranges::to_vector; }) | ranges::to_vector;
_suggestedUpdated.fire({}); _suggestedUpdated.fire({});
}).fail([=](const MTP::Error &error) { }).fail([=] {
_suggestedRequestId = 0; _suggestedRequestId = 0;
_suggestedLastReceived = crl::now() + kRefreshSuggestedTimeout / 2; _suggestedLastReceived = crl::now() + kRefreshSuggestedTimeout / 2;

View file

@ -192,7 +192,7 @@ void CloudThemes::reloadCurrent() {
MTP_long(fields.documentId) MTP_long(fields.documentId)
)).done([=](const MTPTheme &result) { )).done([=](const MTPTheme &result) {
applyUpdate(result); applyUpdate(result);
}).fail([=](const MTP::Error &error) { }).fail([=] {
_reloadCurrentTimer.callOnce(kReloadTimeout); _reloadCurrentTimer.callOnce(kReloadTimeout);
}).send(); }).send();
} }
@ -345,7 +345,7 @@ void CloudThemes::refresh() {
_updates.fire({}); _updates.fire({});
}, [](const MTPDaccount_themesNotModified &) { }, [](const MTPDaccount_themesNotModified &) {
}); });
}).fail([=](const MTP::Error &error) { }).fail([=] {
_refreshRequestId = 0; _refreshRequestId = 0;
}).send(); }).send();
} }
@ -373,7 +373,7 @@ void CloudThemes::refreshChatThemes() {
_chatThemesUpdates.fire({}); _chatThemesUpdates.fire({});
}, [](const MTPDaccount_themesNotModified &) { }, [](const MTPDaccount_themesNotModified &) {
}); });
}).fail([=](const MTP::Error &error) { }).fail([=] {
_chatThemesRequestId = 0; _chatThemesRequestId = 0;
}).send(); }).send();
} }

View file

@ -135,7 +135,7 @@ void GroupCall::requestParticipants() {
_participantsReloaded.fire({}); _participantsReloaded.fire({});
} }
}); });
}).fail([=](const MTP::Error &error) { }).fail([=] {
_participantsRequestId = 0; _participantsRequestId = 0;
const auto reloaded = processSavedFullCall(); const auto reloaded = processSavedFullCall();
setServerParticipantsCount(_participants.size()); setServerParticipantsCount(_participants.size());
@ -511,7 +511,7 @@ void GroupCall::reload() {
} }
_reloadRequestId = 0; _reloadRequestId = 0;
processFullCall(result); processFullCall(result);
}).fail([=](const MTP::Error &error) { }).fail([=] {
_reloadRequestId = 0; _reloadRequestId = 0;
}).send(); }).send();
} }
@ -898,7 +898,7 @@ void GroupCall::requestUnknownParticipants() {
_participantsResolved.fire(&ssrcs); _participantsResolved.fire(&ssrcs);
} }
requestUnknownParticipants(); requestUnknownParticipants();
}).fail([=](const MTP::Error &error) { }).fail([=] {
_unknownParticipantPeersRequestId = 0; _unknownParticipantPeersRequestId = 0;
for (const auto &[ssrc, when] : ssrcs) { for (const auto &[ssrc, when] : ssrcs) {
_unknownSpokenSsrcs.remove(ssrc); _unknownSpokenSsrcs.remove(ssrc);

View file

@ -268,7 +268,7 @@ void Histories::requestDialogEntry(not_null<Data::Folder*> folder) {
)).done([=](const MTPmessages_PeerDialogs &result) { )).done([=](const MTPmessages_PeerDialogs &result) {
applyPeerDialogs(result); applyPeerDialogs(result);
_dialogFolderRequests.remove(folder); _dialogFolderRequests.remove(folder);
}).fail([=](const MTP::Error &error) { }).fail([=] {
_dialogFolderRequests.remove(folder); _dialogFolderRequests.remove(folder);
}).send(); }).send();
} }
@ -348,7 +348,7 @@ void Histories::sendDialogRequests() {
)).done([=](const MTPmessages_PeerDialogs &result) { )).done([=](const MTPmessages_PeerDialogs &result) {
applyPeerDialogs(result); applyPeerDialogs(result);
finalize(); finalize();
}).fail([=](const MTP::Error &error) { }).fail([=] {
finalize(); finalize();
}).send(); }).send();
} }
@ -428,7 +428,7 @@ void Histories::requestFakeChatListMessage(
_fakeChatListRequests.erase(history); _fakeChatListRequests.erase(history);
history->setFakeChatListMessageFrom(result); history->setFakeChatListMessageFrom(result);
finish(); finish();
}).fail([=](const MTP::Error &error) { }).fail([=] {
_fakeChatListRequests.erase(history); _fakeChatListRequests.erase(history);
history->setFakeChatListMessageFrom(MTP_messages_messages( history->setFakeChatListMessageFrom(MTP_messages_messages(
MTP_vector<MTPMessage>(0), MTP_vector<MTPMessage>(0),
@ -472,7 +472,7 @@ void Histories::requestGroupAround(not_null<HistoryItem*> item) {
history->channelId(), history->channelId(),
result); result);
finish(); finish();
}).fail([=](const MTP::Error &error) { }).fail([=] {
_chatListGroupRequests.remove(history); _chatListGroupRequests.remove(history);
finish(); finish();
}).send(); }).send();
@ -555,7 +555,7 @@ void Histories::sendReadRequest(not_null<History*> history, State &state) {
MTP_int(tillId) MTP_int(tillId)
)).done([=](const MTPBool &result) { )).done([=](const MTPBool &result) {
finished(); finished();
}).fail([=](const MTP::Error &error) { }).fail([=] {
finished(); finished();
}).send(); }).send();
} else { } else {
@ -565,7 +565,7 @@ void Histories::sendReadRequest(not_null<History*> history, State &state) {
)).done([=](const MTPmessages_AffectedMessages &result) { )).done([=](const MTPmessages_AffectedMessages &result) {
session().api().applyAffectedMessages(history->peer, result); session().api().applyAffectedMessages(history->peer, result);
finished(); finished();
}).fail([=](const MTP::Error &error) { }).fail([=] {
finished(); finished();
}).send(); }).send();
} }
@ -610,20 +610,17 @@ void Histories::deleteMessages(
finish(); finish();
history->requestChatListMessage(); history->requestChatListMessage();
}; };
const auto fail = [=](const MTP::Error &error) {
finish();
};
if (const auto channel = history->peer->asChannel()) { if (const auto channel = history->peer->asChannel()) {
return session().api().request(MTPchannels_DeleteMessages( return session().api().request(MTPchannels_DeleteMessages(
channel->inputChannel, channel->inputChannel,
MTP_vector<MTPint>(ids) MTP_vector<MTPint>(ids)
)).done(done).fail(fail).send(); )).done(done).fail(finish).send();
} else { } else {
using Flag = MTPmessages_DeleteMessages::Flag; using Flag = MTPmessages_DeleteMessages::Flag;
return session().api().request(MTPmessages_DeleteMessages( return session().api().request(MTPmessages_DeleteMessages(
MTP_flags(revoke ? Flag::f_revoke : Flag(0)), MTP_flags(revoke ? Flag::f_revoke : Flag(0)),
MTP_vector<MTPint>(ids) MTP_vector<MTPint>(ids)
)).done(done).fail(fail).send(); )).done(done).fail(finish).send();
} }
}); });
} }
@ -635,9 +632,6 @@ void Histories::deleteAllMessages(
bool revoke) { bool revoke) {
sendRequest(history, RequestType::Delete, [=](Fn<void()> finish) { sendRequest(history, RequestType::Delete, [=](Fn<void()> finish) {
const auto peer = history->peer; const auto peer = history->peer;
const auto fail = [=](const MTP::Error &error) {
finish();
};
const auto chat = peer->asChat(); const auto chat = peer->asChat();
const auto channel = peer->asChannel(); const auto channel = peer->asChannel();
if (!justClear && revoke && channel && channel->canDelete()) { if (!justClear && revoke && channel && channel->canDelete()) {
@ -656,7 +650,7 @@ void Histories::deleteAllMessages(
MTP_int(deleteTillId) MTP_int(deleteTillId)
)).done([=](const MTPBool &result) { )).done([=](const MTPBool &result) {
finish(); finish();
}).fail(fail).send(); }).fail(finish).send();
} else if (revoke && chat && chat->amCreator()) { } else if (revoke && chat && chat->amCreator()) {
return session().api().request(MTPmessages_DeleteChat( return session().api().request(MTPmessages_DeleteChat(
chat->inputChat chat->inputChat
@ -704,7 +698,7 @@ void Histories::deleteAllMessages(
revoke); revoke);
} }
finish(); finish();
}).fail(fail).send(); }).fail(finish).send();
} }
}); });
} }
@ -734,9 +728,6 @@ void Histories::deleteMessagesByDates(
bool revoke) { bool revoke) {
sendRequest(history, RequestType::Delete, [=](Fn<void()> finish) { sendRequest(history, RequestType::Delete, [=](Fn<void()> finish) {
const auto peer = history->peer; const auto peer = history->peer;
const auto fail = [=](const MTP::Error &error) {
finish();
};
using Flag = MTPmessages_DeleteHistory::Flag; using Flag = MTPmessages_DeleteHistory::Flag;
const auto flags = Flag::f_just_clear const auto flags = Flag::f_just_clear
| Flag::f_min_date | Flag::f_min_date
@ -756,7 +747,7 @@ void Histories::deleteMessagesByDates(
deleteMessagesByDates(history, minDate, maxDate, revoke); deleteMessagesByDates(history, minDate, maxDate, revoke);
} }
finish(); finish();
}).fail(fail).send(); }).fail(finish).send();
}); });
history->destroyMessagesByDates(minDate, maxDate); history->destroyMessagesByDates(minDate, maxDate);
} }

View file

@ -461,7 +461,7 @@ void RepliesList::loadAround(MsgId id) {
_skippedBefore = 0; _skippedBefore = 0;
} }
} }
}).fail([=](const MTP::Error &error) { }).fail([=] {
_beforeId = 0; _beforeId = 0;
_loadingAround = std::nullopt; _loadingAround = std::nullopt;
finish(); finish();
@ -509,7 +509,7 @@ void RepliesList::loadBefore() {
_fullCount = _list.size(); _fullCount = _list.size();
} }
} }
}).fail([=](const MTP::Error &error) { }).fail([=] {
_beforeId = 0; _beforeId = 0;
finish(); finish();
}).send(); }).send();
@ -553,7 +553,7 @@ void RepliesList::loadAfter() {
_fullCount = _list.size(); _fullCount = _list.size();
} }
} }
}).fail([=](const MTP::Error &error) { }).fail([=] {
_afterId = 0; _afterId = 0;
finish(); finish();
}).send(); }).send();

View file

@ -389,7 +389,7 @@ void ScheduledMessages::request(not_null<History*> history) {
MTP_long(hash)) MTP_long(hash))
).done([=](const MTPmessages_Messages &result) { ).done([=](const MTPmessages_Messages &result) {
parse(history, result); parse(history, result);
}).fail([=](const MTP::Error &error) { }).fail([=] {
_requests.remove(history); _requests.remove(history);
}).send(); }).send();
} }

View file

@ -391,7 +391,7 @@ void SearchController::requestMore(
parsed.noSkipRange, parsed.noSkipRange,
parsed.fullCount); parsed.fullCount);
finish(); finish();
}).fail([=](const MTP::Error &error) { }).fail([=] {
finish(); finish();
}).send(); }).send();
}); });

View file

@ -124,7 +124,7 @@ void SponsoredMessages::request(not_null<History*> history) {
channel->inputChannel) channel->inputChannel)
).done([=](const MTPmessages_sponsoredMessages &result) { ).done([=](const MTPmessages_sponsoredMessages &result) {
parse(history, result); parse(history, result);
}).fail([=](const MTP::Error &error) { }).fail([=] {
_requests.remove(history); _requests.remove(history);
}).send(); }).send();
} }
@ -228,7 +228,7 @@ void SponsoredMessages::view(const FullMsgId &fullId) {
auto &request = _viewRequests[randomId]; auto &request = _viewRequests[randomId];
request.lastReceived = crl::now(); request.lastReceived = crl::now();
request.requestId = 0; request.requestId = 0;
}).fail([=](const MTP::Error &error) { }).fail([=] {
_viewRequests.remove(randomId); _viewRequests.remove(randomId);
}).send(); }).send();
} }

View file

@ -539,7 +539,7 @@ void Stickers::requestSetToPushFaved(not_null<DocumentData*> document) {
}, [](const MTPDmessages_stickerSetNotModified &) { }, [](const MTPDmessages_stickerSetNotModified &) {
LOG(("API Error: Unexpected messages.stickerSetNotModified.")); LOG(("API Error: Unexpected messages.stickerSetNotModified."));
}); });
}).fail([=](const MTP::Error &error) { }).fail([=] {
// Perhaps this is a deleted sticker pack. Add anyway. // Perhaps this is a deleted sticker pack. Add anyway.
addAnyway({}); addAnyway({});
}).send(); }).send();

View file

@ -767,7 +767,7 @@ void InnerWidget::preloadMore(Direction direction) {
if (!loadedFlag) { if (!loadedFlag) {
addEvents(direction, results.vevents().v); addEvents(direction, results.vevents().v);
} }
}).fail([this, &requestId, &loadedFlag](const MTP::Error &error) { }).fail([this, &requestId, &loadedFlag] {
requestId = 0; requestId = 0;
loadedFlag = true; loadedFlag = true;
update(); update();
@ -1431,7 +1431,7 @@ void InnerWidget::suggestRestrictParticipant(
|| (type == mtpc_channelParticipantCreator); || (type == mtpc_channelParticipantCreator);
editRestrictions(hasAdminRights, ChatRestrictionsInfo()); editRestrictions(hasAdminRights, ChatRestrictionsInfo());
} }
}).fail([=](const MTP::Error &error) { }).fail([=] {
editRestrictions(false, ChatRestrictionsInfo()); editRestrictions(false, ChatRestrictionsInfo());
}).send(); }).send();
} }

View file

@ -321,7 +321,7 @@ void FastShareMessage(not_null<HistoryItem*> item) {
Ui::hideLayer(); Ui::hideLayer();
} }
finish(); finish();
}).fail([=](const MTP::Error &error) { }).fail([=] {
finish(); finish();
}).afterRequest(history->sendRequestId).send(); }).afterRequest(history->sendRequestId).send();
return history->sendRequestId; return history->sendRequestId;

View file

@ -78,7 +78,7 @@ void AutoDeleteSettingsBox(
if (const auto strong = state->weak.data()) { if (const auto strong = state->weak.data()) {
strong->closeBox(); strong->closeBox();
} }
}).fail([=](const MTP::Error &error) { }).fail([=] {
state->savingRequestId = 0; state->savingRequestId = 0;
}).send(); }).send();
}; };

View file

@ -1124,7 +1124,6 @@ void SendReport(
MTP_string(comment) MTP_string(comment)
)).done([=](const MTPBool &result) { )).done([=](const MTPBool &result) {
Ui::Toast::Show(tr::lng_report_thanks(tr::now)); Ui::Toast::Show(tr::lng_report_thanks(tr::now));
}).fail([=](const MTP::Error &error) {
}).send(); }).send();
} else { } else {
auto apiIds = QVector<MTPint>(); auto apiIds = QVector<MTPint>();
@ -1139,7 +1138,6 @@ void SendReport(
MTP_string(comment) MTP_string(comment)
)).done([=](const MTPBool &result) { )).done([=](const MTPBool &result) {
Ui::Toast::Show(tr::lng_report_thanks(tr::now)); Ui::Toast::Show(tr::lng_report_thanks(tr::now));
}).fail([=](const MTP::Error &error) {
}).send(); }).send();
} }
} }

View file

@ -298,7 +298,7 @@ void ListController::loadMoreRows() {
delegate()->peerListRefreshRows(); delegate()->peerListRefreshRows();
} }
_loadRequestId = 0; _loadRequestId = 0;
}).fail([=](const MTP::Error &error) { }).fail([=] {
_loadRequestId = 0; _loadRequestId = 0;
}).send(); }).send();
} }

View file

@ -447,7 +447,7 @@ void Widget::onInlineRequest() {
MTP_string(nextOffset) MTP_string(nextOffset)
)).done([=](const MTPmessages_BotResults &result) { )).done([=](const MTPmessages_BotResults &result) {
inlineResultsDone(result); inlineResultsDone(result);
}).fail([=](const MTP::Error &error) { }).fail([=] {
// show error? // show error?
_requesting.fire(false); _requesting.fire(false);
_inlineRequestId = 0; _inlineRequestId = 0;

View file

@ -166,7 +166,7 @@ void Step::finish(const MTPUser &user, QImage &&photo) {
api().request(MTPmessages_GetDialogFilters( api().request(MTPmessages_GetDialogFilters(
)).done([=](const MTPVector<MTPDialogFilter> &result) { )).done([=](const MTPVector<MTPDialogFilter> &result) {
createSession(user, photo, result.v); createSession(user, photo, result.v);
}).fail([=](const MTP::Error &error) { }).fail([=] {
createSession(user, photo, QVector<MTPDialogFilter>()); createSession(user, photo, QVector<MTPDialogFilter>());
}).send(); }).send();
} }

View file

@ -234,7 +234,7 @@ void CloudManager::requestLangPackDifference(Pack pack) {
)).done([=](const MTPLangPackDifference &result) { )).done([=](const MTPLangPackDifference &result) {
packRequestId(pack) = 0; packRequestId(pack) = 0;
applyLangPackDifference(result); applyLangPackDifference(result);
}).fail([=](const MTP::Error &error) { }).fail([=] {
packRequestId(pack) = 0; packRequestId(pack) = 0;
}).send(); }).send();
} else { } else {
@ -244,7 +244,7 @@ void CloudManager::requestLangPackDifference(Pack pack) {
)).done([=](const MTPLangPackDifference &result) { )).done([=](const MTPLangPackDifference &result) {
packRequestId(pack) = 0; packRequestId(pack) = 0;
applyLangPackDifference(result); applyLangPackDifference(result);
}).fail([=](const MTP::Error &error) { }).fail([=] {
packRequestId(pack) = 0; packRequestId(pack) = 0;
}).send(); }).send();
} }
@ -322,7 +322,7 @@ void CloudManager::requestLanguageList() {
_languageListChanged.fire({}); _languageListChanged.fire({});
} }
_languagesRequestId = 0; _languagesRequestId = 0;
}).fail([=](const MTP::Error &error) { }).fail([=] {
_languagesRequestId = 0; _languagesRequestId = 0;
}).send(); }).send();
} }
@ -509,7 +509,7 @@ void CloudManager::switchToLanguage(const Language &data) {
tr::lng_cancel(tr::now), tr::lng_cancel(tr::now),
[=] { performSwitchAndRestart(data); }), [=] { performSwitchAndRestart(data); }),
Ui::LayerOption::KeepOther); Ui::LayerOption::KeepOther);
}).fail([=](const MTP::Error &error) { }).fail([=] {
_getKeysForSwitchRequestId = 0; _getKeysForSwitchRequestId = 0;
}).send(); }).send();
} }

View file

@ -51,7 +51,7 @@ void AppConfig::refresh() {
DEBUG_LOG(("getAppConfig result handled.")); DEBUG_LOG(("getAppConfig result handled."));
} }
_refreshed.fire({}); _refreshed.fire({});
}).fail([=](const MTP::Error &error) { }).fail([=] {
_requestId = 0; _requestId = 0;
refreshDelayed(); refreshDelayed();
}).send(); }).send();

View file

@ -1038,7 +1038,7 @@ void FormController::cancelPassword() {
)).done([=](const MTPBool &result) { )).done([=](const MTPBool &result) {
_passwordRequestId = 0; _passwordRequestId = 0;
reloadPassword(); reloadPassword();
}).fail([=](const MTP::Error &error) { }).fail([=] {
_passwordRequestId = 0; _passwordRequestId = 0;
reloadPassword(); reloadPassword();
}).send(); }).send();
@ -1259,7 +1259,7 @@ rpl::producer<EditDocumentCountry> FormController::preferredLanguage(
}); });
consumer.put_next({ countryCode, findLang() }); consumer.put_next({ countryCode, findLang() });
consumer.put_done(); consumer.put_done();
}).fail([=](const MTP::Error &error) { }).fail([=] {
consumer.put_next({ countryCode, QString() }); consumer.put_next({ countryCode, QString() });
consumer.put_done(); consumer.put_done();
}).send(); }).send();

View file

@ -329,7 +329,7 @@ void SetupHelp(
Ui::showPeerHistory(user, ShowAtUnreadMsgId); Ui::showPeerHistory(user, ShowAtUnreadMsgId);
} }
}); });
}).fail([=](const MTP::Error &error) { }).fail([=] {
*requestId = 0; *requestId = 0;
}).send(); }).send();
}); });

View file

@ -263,7 +263,7 @@ Helper::Helper(not_null<Main::Session*> session)
result.match([&](const MTPDhelp_supportName &data) { result.match([&](const MTPDhelp_supportName &data) {
setSupportName(qs(data.vname())); setSupportName(qs(data.vname()));
}); });
}).fail([=](const MTP::Error &error) { }).fail([=] {
setSupportName( setSupportName(
qsl("[rand^") qsl("[rand^")
+ QString::number(Core::Sandbox::Instance().installationTag()) + QString::number(Core::Sandbox::Instance().installationTag())
@ -529,7 +529,7 @@ void Helper::saveInfo(
)).done([=](const MTPhelp_UserInfo &result) { )).done([=](const MTPhelp_UserInfo &result) {
applyInfo(user, result); applyInfo(user, result);
done(true); done(true);
}).fail([=](const MTP::Error &error) { }).fail([=] {
done(false); done(false);
}).send(); }).send();
} }

View file

@ -743,7 +743,7 @@ void SaveTheme(
result.match([&](const MTPDtheme &data) { result.match([&](const MTPDtheme &data) {
save(CloudTheme::Parse(&window->account().session(), data)); save(CloudTheme::Parse(&window->account().session(), data));
}); });
}).fail([=](const MTP::Error &error) { }).fail([=] {
save(CloudTheme()); save(CloudTheme());
}).send(); }).send();
} else { } else {

View file

@ -240,9 +240,7 @@ void SessionNavigation::resolveChannelById(
fail(); fail();
} }
}); });
}).fail([=](const MTP::Error &error) { }).fail(fail).send();
fail();
}).send();
} }
void SessionNavigation::showPeerByLinkResolved( void SessionNavigation::showPeerByLinkResolved(
@ -301,9 +299,7 @@ void SessionNavigation::showPeerByLinkResolved(
} else { } else {
bad(); bad();
} }
}).fail([=](const MTP::Error &error) { }).fail(bad).send();
bad();
}).send();
}).send(); }).send();
return; return;
} }