From 96f7c0c02e93cc8e9594d36fd5348357da29b84b Mon Sep 17 00:00:00 2001 From: John Preston Date: Fri, 18 May 2018 19:41:59 +0300 Subject: [PATCH] Don't try to logout CDN dcs. --- Telegram/SourceFiles/mtproto/mtp_instance.cpp | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/Telegram/SourceFiles/mtproto/mtp_instance.cpp b/Telegram/SourceFiles/mtproto/mtp_instance.cpp index 705526344..3350ed075 100644 --- a/Telegram/SourceFiles/mtproto/mtp_instance.cpp +++ b/Telegram/SourceFiles/mtproto/mtp_instance.cpp @@ -1358,13 +1358,17 @@ internal::Session *Instance::Private::getSession(ShiftedDcId shiftedDcId) { void Instance::Private::scheduleKeyDestroy(ShiftedDcId shiftedDcId) { Expects(isKeysDestroyer()); - _instance->send(MTPauth_LogOut(), rpcDone([this, shiftedDcId](const MTPBool &result) { + if (dcOptions()->dcType(shiftedDcId) == DcType::Cdn) { performKeyDestroy(shiftedDcId); - }), rpcFail([this, shiftedDcId](const RPCError &error) { - if (isDefaultHandledError(error)) return false; - performKeyDestroy(shiftedDcId); - return true; - }), shiftedDcId); + } else { + _instance->send(MTPauth_LogOut(), rpcDone([=](const MTPBool &) { + performKeyDestroy(shiftedDcId); + }), rpcFail([=](const RPCError &error) { + if (isDefaultHandledError(error)) return false; + performKeyDestroy(shiftedDcId); + return true; + }), shiftedDcId); + } } void Instance::Private::performKeyDestroy(ShiftedDcId shiftedDcId) {