summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGeorge Hazan <ghazan@miranda.im>2019-05-11 18:15:01 +0300
committerGeorge Hazan <ghazan@miranda.im>2019-05-11 18:15:01 +0300
commit9e5b824d6981312015f69d3da7b0f11f44492976 (patch)
tree331395dd2d4dba484a72401ddd17ef543208d659
parent289f73c0c5d58c083c02c7c5b12427ebb8147625 (diff)
crash fix for Discord, if server required a captcha
-rw-r--r--protocols/Discord/discord.vcxproj4
-rw-r--r--protocols/Discord/src/server.cpp6
2 files changed, 4 insertions, 6 deletions
diff --git a/protocols/Discord/discord.vcxproj b/protocols/Discord/discord.vcxproj
index ab81bd4bb4..44e21b16ef 100644
--- a/protocols/Discord/discord.vcxproj
+++ b/protocols/Discord/discord.vcxproj
@@ -36,8 +36,4 @@
<Project>{f6a9340e-b8d9-4c75-be30-47dc66d0abc7}</Project>
</ProjectReference>
</ItemGroup>
- <ItemGroup>
- <Image Include="res\discord.ico" />
- <Image Include="res\groupchat.ico" />
- </ItemGroup>
</Project> \ No newline at end of file
diff --git a/protocols/Discord/src/server.cpp b/protocols/Discord/src/server.cpp
index 0c8f31bf5b..eef014b3fa 100644
--- a/protocols/Discord/src/server.cpp
+++ b/protocols/Discord/src/server.cpp
@@ -280,8 +280,10 @@ void CDiscordProto::OnReceiveToken(NETLIBHTTPREQUEST *pReply, AsyncHttpRequest*)
JSONNode root = JSONNode::parse(pReply->pData);
if (root) {
const JSONNode &captcha = root["captcha_key"].as_array();
- if (captcha && captcha.begin()[0].as_mstring() == "captcha-required") {
- debugLogA("captcha required");
+ if (captcha) {
+ for (auto& it : captcha)
+ if (it.as_mstring() == "captcha-required")
+ debugLogA("captcha required");
}
}
ConnectionFailed(LOGINERR_WRONGPASSWORD);