Index: ps/trunk/binaries/data/mods/public/gui/lobby/lobby.js =================================================================== --- ps/trunk/binaries/data/mods/public/gui/lobby/lobby.js +++ ps/trunk/binaries/data/mods/public/gui/lobby/lobby.js @@ -153,7 +153,7 @@ addChatMessage({ "from": "system", "time": msg.time, - "text": translate("Disconnected.") + " " + msg.reason + "text": translate("Disconnected.") + " " + msg.reason + msg.certificate_status }); reconnectMessageBox(); } Index: ps/trunk/binaries/data/mods/public/gui/prelobby/common/feedback/feedback.js =================================================================== --- ps/trunk/binaries/data/mods/public/gui/prelobby/common/feedback/feedback.js +++ ps/trunk/binaries/data/mods/public/gui/prelobby/common/feedback/feedback.js @@ -5,7 +5,7 @@ Engine.StopXmppClient(); }, "disconnected": message => { - setFeedback(message.reason); + setFeedback(message.reason + message.certificate_status); Engine.StopXmppClient(); } }; Index: ps/trunk/source/lobby/XmppClient.h =================================================================== --- ps/trunk/source/lobby/XmppClient.h +++ ps/trunk/source/lobby/XmppClient.h @@ -141,9 +141,9 @@ // Helpers void GetPresenceString(const gloox::Presence::PresenceType p, std::string& presence) const; void GetRoleString(const gloox::MUCRoomRole r, std::string& role) const; - std::string TLSErrorToString(gloox::CertStatus status) const; std::string StanzaErrorToString(gloox::StanzaError err) const; std::string ConnectionErrorToString(gloox::ConnectionError err) const; + std::string CertificateErrorToString(gloox::CertStatus status) const; std::string RegistrationResultToString(gloox::RegistrationResult res) const; std::time_t ComputeTimestamp(const glooxwrapper::Message& msg) const; Index: ps/trunk/source/lobby/XmppClient.cpp =================================================================== --- ps/trunk/source/lobby/XmppClient.cpp +++ ps/trunk/source/lobby/XmppClient.cpp @@ -279,7 +279,12 @@ m_HistoricGuiMessages.clear(); m_isConnected = false; - CreateGUIMessage("system", "disconnected", std::time(nullptr), "reason", ConnectionErrorToString(error)); + CreateGUIMessage( + "system", + "disconnected", + std::time(nullptr), + "reason", ConnectionErrorToString(error), + "certificate_status", CertificateErrorToString(m_certStatus)); } /** @@ -1098,7 +1103,7 @@ * Translates a gloox certificate error codes, i.e. gloox certificate statuses except CertOk. * Keep in sync with specifications. */ -std::string XmppClient::TLSErrorToString(gloox::CertStatus status) const +std::string XmppClient::CertificateErrorToString(gloox::CertStatus status) const { std::map certificateErrorStrings = { { gloox::CertInvalid, g_L10n.Translate("The certificate is not trusted.") }, @@ -1110,7 +1115,7 @@ { gloox::CertSignerNotCa, g_L10n.Translate("The certificate signer is not a certificate authority.") } }; - std::string result = ""; + std::string result; for (std::map::iterator it = certificateErrorStrings.begin(); it != certificateErrorStrings.end(); ++it) if (status & it->first) @@ -1189,7 +1194,7 @@ CASE(ConnDnsError, g_L10n.Translate("Resolving the server's hostname failed")); CASE(ConnOutOfMemory, g_L10n.Translate("This system is out of memory")); DEBUG_CASE(ConnNoSupportedAuth, "The authentication mechanisms the server offered are not supported or no authentication mechanisms were available"); - CASE(ConnTlsFailed, g_L10n.Translate("The server's certificate could not be verified or the TLS handshake did not complete successfully") + TLSErrorToString(m_certStatus)); + CASE(ConnTlsFailed, g_L10n.Translate("The server's certificate could not be verified or the TLS handshake did not complete successfully")); CASE(ConnTlsNotAvailable, g_L10n.Translate("The server did not offer required TLS encryption")); DEBUG_CASE(ConnCompressionFailed, "Negotiation/initializing compression failed"); CASE(ConnAuthenticationFailed, g_L10n.Translate("Authentication failed. Incorrect password or account does not exist"));