diff options
author | George Hazan <ghazan@miranda.im> | 2021-06-04 22:40:23 +0300 |
---|---|---|
committer | George Hazan <ghazan@miranda.im> | 2021-06-04 22:40:23 +0300 |
commit | 4fdc401d4e5f91aa55f4ea4214ea484c25ac6ce3 (patch) | |
tree | 8f01f7d020a9bb564f279e09786b7c61475e1240 | |
parent | dc27e48845901137450c303917a322a682104ca3 (diff) |
fixes #2900 (Discord: implement popup if login/password are incorrect)
-rw-r--r-- | protocols/Discord/src/server.cpp | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/protocols/Discord/src/server.cpp b/protocols/Discord/src/server.cpp index ec2e5e816c..2b4882ed37 100644 --- a/protocols/Discord/src/server.cpp +++ b/protocols/Discord/src/server.cpp @@ -271,6 +271,18 @@ void CDiscordProto::OnReceiveToken(NETLIBHTTPREQUEST *pReply, AsyncHttpRequest*) } } } + + for (auto &err: root["errors"]["email"]["_errors"]) { + CMStringW code(err["code"].as_mstring()); + CMStringW message(err["message"].as_mstring()); + if (!code.IsEmpty() || !message.IsEmpty()) { + POPUPDATAW popup; + popup.lchIcon = IcoLib_GetIconByHandle(Skin_GetIconHandle(SKINICON_ERROR), true); + wcscpy_s(popup.lpwzContactName, m_tszUserName); + mir_snwprintf(popup.lpwzText, TranslateT("Connection failed.\n%s (%s)."), message.c_str(), code.c_str()); + PUAddPopupW(&popup); + } + } } ConnectionFailed(LOGINERR_WRONGPASSWORD); return; |