startTLS: handle ui messages

This commit is contained in:
Alberto Sottile 2019-02-05 16:48:23 +01:00
parent 0c46f54510
commit 3fc9dcf0af
6 changed files with 14 additions and 14 deletions

View File

@ -312,8 +312,8 @@ de = {
# startTLS messages - TODO: Translate
"startTLS-initiated": "Attempting secure connection",
"startTLS-secure-connection-ok": "Secure connection established ({})",
"startTLS-not-supported-client": "This client does not support TLS",
"startTLS-secure-connection-ok": "Secure connection established",
"startTLS-not-supported-client": "TLS is not supported",
"startTLS-not-supported-server": "This server does not support TLS",
# About dialog - TODO: Translate

View File

@ -313,8 +313,8 @@ en = {
"update-menu-label": "Check for &update",
"startTLS-initiated": "Attempting secure connection",
"startTLS-secure-connection-ok": "Secure connection established ({})",
"startTLS-not-supported-client": "This client does not support TLS",
"startTLS-secure-connection-ok": "Secure connection established",
"startTLS-not-supported-client": "TLS is not supported",
"startTLS-not-supported-server": "This server does not support TLS",
# About dialog
@ -444,7 +444,7 @@ en = {
"server-chat-maxchars-argument": "Maximum number of characters in a chat message (default is {})", # Default number of characters
"server-maxusernamelength-argument": "Maximum number of characters in a username (default is {})",
"server-stats-db-file-argument": "Enable server stats using the SQLite db file provided",
"server-tls-argument": "Enable TLS connections using the certificate file provided",
"server-startTLS-argument": "Enable TLS connections using the certificate files in the path provided",
"server-messed-up-motd-unescaped-placeholders": "Message of the Day has unescaped placeholders. All $ signs should be doubled ($$).",
"server-messed-up-motd-too-long": "Message of the Day is too long - maximum of {} chars, {} given.",

View File

@ -313,8 +313,8 @@ it = {
"update-menu-label": "Controlla la presenza di &aggiornamenti",
"startTLS-initiated": "Tentativo di connessione sicura in corso",
"startTLS-secure-connection-ok": "Connessione sicura stabilita ({})",
"startTLS-not-supported-client": "Questo client non supporta TLS",
"startTLS-secure-connection-ok": "Connessione sicura stabilita",
"startTLS-not-supported-client": "TLS non è supportato",
"startTLS-not-supported-server": "Questo server non supporta TLS",
# About dialog

View File

@ -315,8 +315,8 @@ ru = {
# startTLS messages - TODO: Translate
"startTLS-initiated": "Attempting secure connection",
"startTLS-secure-connection-ok": "Secure connection established ({})",
"startTLS-not-supported-client": "This client does not support TLS",
"startTLS-secure-connection-ok": "Secure connection established",
"startTLS-not-supported-client": "TLS is not supported",
"startTLS-not-supported-server": "This server does not support TLS",
# About dialog - TODO: Translate

View File

@ -79,9 +79,9 @@ class SyncClientProtocol(JSONCommandProtocol):
self._client.initProtocol(self)
if self._client._serverSupportsTLS:
self.sendTLS({"startTLS": "send"})
self._client.ui.showMessage("Attempting secure connection")
self._client.ui.showMessage(getMessage("startTLS-initiated"))
else:
self._client.ui.showErrorMessage("TLS is not supported")
self._client.ui.showErrorMessage(getMessage("startTLS-not-supported-client"))
self.sendHello()
def connectionLost(self, reason):
@ -328,9 +328,9 @@ class SyncClientProtocol(JSONCommandProtocol):
answer = message["startTLS"] if "startTLS" in message else None
if "true" in answer and not self.logged and self._client.protocolFactory.options is not None:
self.transport.startTLS(self._client.protocolFactory.options)
self._client.ui.showMessage("Secure connection established")
self._client.ui.showMessage(getMessage("startTLS-secure-connection-ok"))
elif "false" in answer:
self._client.ui.showErrorMessage("This server does not support TLS")
self._client.ui.showErrorMessage(getMessage("startTLS-not-supported-server"))
self.sendHello()
class SyncServerProtocol(JSONCommandProtocol):

View File

@ -649,4 +649,4 @@ class ConfigurationGetter(object):
self._argparser.add_argument('--max-chat-message-length', metavar='maxChatMessageLength', type=int, nargs='?', help=getMessage("server-chat-maxchars-argument").format(constants.MAX_CHAT_MESSAGE_LENGTH))
self._argparser.add_argument('--max-username-length', metavar='maxUsernameLength', type=int, nargs='?', help=getMessage("server-maxusernamelength-argument").format(constants.MAX_USERNAME_LENGTH))
self._argparser.add_argument('--stats-db-file', metavar='file', type=str, nargs='?', help=getMessage("server-stats-db-file-argument"))
self._argparser.add_argument('--tls', metavar='path', type=str, nargs='?', help=getMessage("server-tls-argument"))
self._argparser.add_argument('--tls', metavar='path', type=str, nargs='?', help=getMessage("server-startTLS-argument"))