From 89dfd2db2ba84f1d2f6bb35a43256fc8183cb9b0 Mon Sep 17 00:00:00 2001
From: George Hazan <ghazan@miranda.im>
Date: Mon, 24 Feb 2020 12:36:03 +0300
Subject: fixes #2230 (DIscord: Sometimes Miranda continuously fails to connect
 to Discord server, and somehow logging in on the website fixes this problem )

---
 protocols/Discord/src/server.cpp | 9 ++++++---
 1 file changed, 6 insertions(+), 3 deletions(-)

(limited to 'protocols/Discord')

diff --git a/protocols/Discord/src/server.cpp b/protocols/Discord/src/server.cpp
index 414c22815d..340087bf89 100644
--- a/protocols/Discord/src/server.cpp
+++ b/protocols/Discord/src/server.cpp
@@ -270,9 +270,12 @@ void CDiscordProto::OnReceiveToken(NETLIBHTTPREQUEST *pReply, AsyncHttpRequest*)
 		if (root) {
 			const JSONNode &captcha = root["captcha_key"].as_array();
 			if (captcha) {
-				for (auto& it : captcha)
-					if (it.as_mstring() == "captcha-required")
-						debugLogA("captcha required");
+				for (auto &it : captcha) {
+					if (it.as_mstring() == "captcha-required") {
+						MessageBoxW(NULL, TranslateT("THe server requires you to enter the captcha. Miranda will redirect you to a browser now"), L"Discord", MB_OK | MB_ICONINFORMATION);
+						Utils_OpenUrl("https://discordapp.com/app");
+					}
+				}
 			}
 		}
 		ConnectionFailed(LOGINERR_WRONGPASSWORD);
-- 
cgit v1.2.3