From b1d563719a166d103ee698b2368b54ac5c6e1757 Mon Sep 17 00:00:00 2001 From: levlam Date: Sun, 4 Nov 2018 13:53:57 +0300 Subject: [PATCH] Simplify should_open in SessionProxy. GitOrigin-RevId: 5bfa92ed175468d5a247780b73d643735427637c --- td/telegram/net/SessionProxy.cpp | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/td/telegram/net/SessionProxy.cpp b/td/telegram/net/SessionProxy.cpp index 71f30150..58d34d59 100644 --- a/td/telegram/net/SessionProxy.cpp +++ b/td/telegram/net/SessionProxy.cpp @@ -162,13 +162,10 @@ void SessionProxy::open_session(bool force) { if (force) { return true; } - if (auth_state_ != AuthState::Empty && need_destroy_) { - return true; - } if (need_destroy_) { - return false; + return auth_state_ != AuthState::Empty; } - if (is_main_ && !need_destroy_) { // alays open main + if (is_main_) { // always open main for ordinary queries return true; } if (!pending_queries_.empty() && auth_state_ == AuthState::OK) {