mirror of
https://github.com/AyuGram/AyuGramDesktop.git
synced 2025-04-18 07:07:08 +02:00
Fix connection re-init in case of CONNECTION_NOT_INITED.
This commit is contained in:
parent
13ad39dfc2
commit
cad6faa790
3 changed files with 7 additions and 1 deletions
Telegram/SourceFiles/mtproto
|
@ -1537,6 +1537,7 @@ bool Instance::Private::onErrorDefault(
|
|||
|
||||
const auto session = getSession(qAbs(dcWithShift));
|
||||
request->needsLayer = true;
|
||||
session->setConnectionNotInited();
|
||||
session->sendPrepared(request);
|
||||
return true;
|
||||
} else if (type == u"CONNECTION_LANG_CODE_INVALID"_q) {
|
||||
|
|
|
@ -257,10 +257,14 @@ void Session::refreshOptions() {
|
|||
}
|
||||
|
||||
void Session::reInitConnection() {
|
||||
_dc->setConnectionInited(false);
|
||||
setConnectionNotInited();
|
||||
restart();
|
||||
}
|
||||
|
||||
void Session::setConnectionNotInited() {
|
||||
_dc->setConnectionInited(false);
|
||||
}
|
||||
|
||||
void Session::stop() {
|
||||
if (_killed) {
|
||||
DEBUG_LOG(("Session Error: can't stop a killed session"));
|
||||
|
|
|
@ -142,6 +142,7 @@ public:
|
|||
|
||||
void start();
|
||||
void reInitConnection();
|
||||
void setConnectionNotInited();
|
||||
|
||||
void restart();
|
||||
void refreshOptions();
|
||||
|
|
Loading…
Add table
Reference in a new issue