mirror of
https://github.com/kotatogram/kotatogram-desktop
synced 2025-08-31 14:45:14 +00:00
Removed unused MTPBool from callbacks on done.
This commit is contained in:
@@ -194,7 +194,7 @@ void Authorizations::updateTTL(int days) {
|
||||
_api.request(_ttlRequestId).cancel();
|
||||
_ttlRequestId = _api.request(MTPaccount_SetAuthorizationTTL(
|
||||
MTP_int(days)
|
||||
)).done([=](const MTPBool &result) {
|
||||
)).done([=] {
|
||||
_ttlRequestId = 0;
|
||||
}).fail([=] {
|
||||
_ttlRequestId = 0;
|
||||
@@ -216,7 +216,7 @@ void Authorizations::toggleCallsDisabled(uint64 hash, bool disabled) {
|
||||
MTP_long(hash),
|
||||
MTPBool(), // encrypted_requests_disabled
|
||||
MTP_bool(disabled)
|
||||
)).done([=](const MTPBool &) {
|
||||
)).done([=] {
|
||||
_toggleCallsDisabledRequests.remove(hash);
|
||||
}).fail([=] {
|
||||
_toggleCallsDisabledRequests.remove(hash);
|
||||
|
@@ -80,7 +80,7 @@ void BlockedPeers::block(not_null<PeerData*> peer) {
|
||||
} else if (_blockRequests.find(peer) == end(_blockRequests)) {
|
||||
const auto requestId = _api.request(MTPcontacts_Block(
|
||||
peer->input
|
||||
)).done([=](const MTPBool &result) {
|
||||
)).done([=] {
|
||||
_blockRequests.erase(peer);
|
||||
peer->setIsBlocked(true);
|
||||
if (_slice) {
|
||||
@@ -109,7 +109,7 @@ void BlockedPeers::unblock(not_null<PeerData*> peer, Fn<void()> onDone) {
|
||||
}
|
||||
const auto requestId = _api.request(MTPcontacts_Unblock(
|
||||
peer->input
|
||||
)).done([=](const MTPBool &result) {
|
||||
)).done([=] {
|
||||
_blockRequests.erase(peer);
|
||||
peer->setIsBlocked(false);
|
||||
if (_slice) {
|
||||
|
@@ -83,7 +83,7 @@ void ConfirmPhone::resolve(
|
||||
_checkRequestId = _api.request(MTPaccount_ConfirmPhone(
|
||||
MTP_string(phoneHash),
|
||||
MTP_string(code)
|
||||
)).done([=](const MTPBool &result) {
|
||||
)).done([=] {
|
||||
_checkRequestId = 0;
|
||||
controller->show(
|
||||
Box<Ui::InformBox>(
|
||||
|
@@ -363,7 +363,7 @@ void InviteLinks::destroy(
|
||||
_api->request(MTPmessages_DeleteExportedChatInvite(
|
||||
peer->input,
|
||||
MTP_string(link)
|
||||
)).done([=](const MTPBool &result) {
|
||||
)).done([=] {
|
||||
const auto callbacks = _deleteCallbacks.take(key);
|
||||
if (callbacks) {
|
||||
for (const auto &callback : *callbacks) {
|
||||
@@ -398,7 +398,7 @@ void InviteLinks::destroyAllRevoked(
|
||||
_api->request(MTPmessages_DeleteRevokedExportedChatInvites(
|
||||
peer->input,
|
||||
admin->inputUser
|
||||
)).done([=](const MTPBool &result) {
|
||||
)).done([=] {
|
||||
if (const auto callbacks = _deleteRevokedCallbacks.take(peer)) {
|
||||
for (const auto &callback : *callbacks) {
|
||||
callback();
|
||||
|
@@ -40,7 +40,7 @@ void SelfDestruct::update(int days) {
|
||||
_api.request(_requestId).cancel();
|
||||
_requestId = _api.request(MTPaccount_SetAccountTTL(
|
||||
MTP_accountDaysTTL(MTP_int(days))
|
||||
)).done([=](const MTPBool &result) {
|
||||
)).done([=] {
|
||||
_requestId = 0;
|
||||
}).fail([=] {
|
||||
_requestId = 0;
|
||||
|
@@ -61,7 +61,7 @@ void SensitiveContent::update(bool enabled) {
|
||||
_api.request(_requestId).cancel();
|
||||
_requestId = _api.request(MTPaccount_SetContentSettings(
|
||||
MTP_flags(enabled ? Flag::f_sensitive_enabled : Flag(0))
|
||||
)).done([=](const MTPBool &result) {
|
||||
)).done([=] {
|
||||
_requestId = 0;
|
||||
}).fail([=] {
|
||||
_requestId = 0;
|
||||
|
@@ -919,7 +919,7 @@ void Updates::updateOnline(crl::time lastNonIdleTime, bool gotOtherOffline) {
|
||||
} else {
|
||||
_onlineRequest = api().request(MTPaccount_UpdateStatus(
|
||||
MTP_bool(!isOnline)
|
||||
)).done([=](const MTPBool &result) {
|
||||
)).done([=] {
|
||||
Core::App().quitPreventFinished();
|
||||
}).fail([=] {
|
||||
Core::App().quitPreventFinished();
|
||||
|
Reference in New Issue
Block a user