Don't try to logout CDN dcs.

This commit is contained in:
John Preston 2018-05-18 19:41:59 +03:00
parent 66b7b6da2a
commit 96f7c0c02e
1 changed files with 10 additions and 6 deletions

View File

@ -1358,13 +1358,17 @@ internal::Session *Instance::Private::getSession(ShiftedDcId shiftedDcId) {
void Instance::Private::scheduleKeyDestroy(ShiftedDcId shiftedDcId) { void Instance::Private::scheduleKeyDestroy(ShiftedDcId shiftedDcId) {
Expects(isKeysDestroyer()); Expects(isKeysDestroyer());
_instance->send(MTPauth_LogOut(), rpcDone([this, shiftedDcId](const MTPBool &result) { if (dcOptions()->dcType(shiftedDcId) == DcType::Cdn) {
performKeyDestroy(shiftedDcId); performKeyDestroy(shiftedDcId);
}), rpcFail([this, shiftedDcId](const RPCError &error) { } else {
if (isDefaultHandledError(error)) return false; _instance->send(MTPauth_LogOut(), rpcDone([=](const MTPBool &) {
performKeyDestroy(shiftedDcId); performKeyDestroy(shiftedDcId);
return true; }), rpcFail([=](const RPCError &error) {
}), shiftedDcId); if (isDefaultHandledError(error)) return false;
performKeyDestroy(shiftedDcId);
return true;
}), shiftedDcId);
}
} }
void Instance::Private::performKeyDestroy(ShiftedDcId shiftedDcId) { void Instance::Private::performKeyDestroy(ShiftedDcId shiftedDcId) {