From 6c7f2cf0fc05b8c86d4684e93bb7325e5d321d78 Mon Sep 17 00:00:00 2001 From: jakob Date: Mon, 18 Jan 2016 01:18:55 +0100 Subject: [PATCH] Show help text for unknown contact identity Adds a new message string "theirIdentityUnknown". Fixes #576 // FREEBIE --- _locales/en/messages.json | 3 +++ background.html | 4 ++++ js/views/key_verification_view.js | 9 +++++++-- stylesheets/_conversation.scss | 4 ++++ stylesheets/manifest.css | 3 +++ 5 files changed, 21 insertions(+), 2 deletions(-) diff --git a/_locales/en/messages.json b/_locales/en/messages.json index a2fb8003..a1ae46b8 100644 --- a/_locales/en/messages.json +++ b/_locales/en/messages.json @@ -104,6 +104,9 @@ "yourIdentity": { "message": "Your identity (you read):" }, + "theirIdentityUnknown": { + "message": "You haven't talked with this contact yet. Their identity will be received with their first message." + }, "deleteMessages": { "message": "Delete messages" }, diff --git a/background.html b/background.html index 647499b0..fbe456ae 100644 --- a/background.html +++ b/background.html @@ -217,8 +217,12 @@

{{theirIdentity}}

+
+ {{ #their_key_unknown }} {{ their_key_unknown }}{{ /their_key_unknown }} +
{{ #their_key }} {{ . }} {{ /their_key }} +

{{yourIdentity}}

diff --git a/js/views/key_verification_view.js b/js/views/key_verification_view.js index bc38c6b9..0f38dba4 100644 --- a/js/views/key_verification_view.js +++ b/js/views/key_verification_view.js @@ -25,13 +25,18 @@ return octets; }, render_attributes: function() { - return { + var attributes = { verifyIdentity: i18n('verifyIdentity'), yourIdentity: i18n('yourIdentity'), theirIdentity: i18n('theirIdentity'), your_key: this.splitKey(this.model.your_key), - their_key: this.splitKey(this.model.their_key) }; + if(this.model.their_key) { + attributes.their_key = this.splitKey(this.model.their_key); + } else { + attributes.their_key_unknown = i18n('theirIdentityUnknown'); + } + return attributes; } }); })(); diff --git a/stylesheets/_conversation.scss b/stylesheets/_conversation.scss index 0b6a7067..ee834982 100644 --- a/stylesheets/_conversation.scss +++ b/stylesheets/_conversation.scss @@ -54,6 +54,10 @@ padding: 0 1em; -webkit-user-select: text; } + .key.placeholder { + font-family: inherit; + font-weight: bold; + } .container { height: calc(100% - (#{$header-height} + 5px + 1px + 4px)); } diff --git a/stylesheets/manifest.css b/stylesheets/manifest.css index acf9a44c..44f992e6 100644 --- a/stylesheets/manifest.css +++ b/stylesheets/manifest.css @@ -620,6 +620,9 @@ input.search { font-family: monospace; padding: 0 1em; -webkit-user-select: text; } + .key-verification .key.placeholder { + font-family: inherit; + font-weight: bold; } .key-verification .container { height: calc(100% - (36px + 5px + 1px + 4px)); }