summaryrefslogtreecommitdiff
path: root/protocols/Discord/src/connection.cpp
diff options
context:
space:
mode:
authorGeorge Hazan <george.hazan@gmail.com>2024-02-10 19:27:14 +0300
committerGeorge Hazan <george.hazan@gmail.com>2024-02-10 19:27:14 +0300
commitc0895c25140c630b03e4c9ece9d290bc0e0b1227 (patch)
tree8da16077aaf4e115a9d7c64bceccd608eb43e390 /protocols/Discord/src/connection.cpp
parent8d9fb2ecdca01805f3a1db7e89a6873286efb898 (diff)
fixes #4178 (Discord: токен очищается при пропадании интернета)
Diffstat (limited to 'protocols/Discord/src/connection.cpp')
-rw-r--r--protocols/Discord/src/connection.cpp4
1 files changed, 3 insertions, 1 deletions
diff --git a/protocols/Discord/src/connection.cpp b/protocols/Discord/src/connection.cpp
index 2fe771c0ed..96cc32ee25 100644
--- a/protocols/Discord/src/connection.cpp
+++ b/protocols/Discord/src/connection.cpp
@@ -104,7 +104,9 @@ void CDiscordProto::ShutdownSession()
void CDiscordProto::ConnectionFailed(int iReason)
{
debugLogA("CDiscordProto::ConnectionFailed -> reason %d", iReason);
- delSetting(DB_KEY_TOKEN);
+
+ if (iReason != LOGINERR_NONETWORK && iReason != LOGINERR_NOSERVER)
+ delSetting(DB_KEY_TOKEN);
ProtoBroadcastAck(0, ACKTYPE_LOGIN, ACKRESULT_FAILED, nullptr, iReason);
ShutdownSession();