From a1e4b740f24924eae9765983503f0a30d1aa1dd0 Mon Sep 17 00:00:00 2001 From: Mikunj Date: Fri, 8 Feb 2019 15:18:53 +1100 Subject: [PATCH] Fixed up settings view. Fix review issues. --- _locales/en/messages.json | 11 ++++++++--- js/views/settings_view.js | 3 ++- libtextsecure/sendmessage.js | 7 ++++--- settings.html | 13 +++++++++---- 4 files changed, 23 insertions(+), 11 deletions(-) diff --git a/_locales/en/messages.json b/_locales/en/messages.json index 52f4889e7..43b522dd3 100644 --- a/_locales/en/messages.json +++ b/_locales/en/messages.json @@ -1102,17 +1102,22 @@ "message": "General", "description": "Header for general options on the settings screen" }, - "sendLinkPreviews": { - "message": "Send Link Previews", + "linkPreviews": { + "message": "Link Previews", "description": "Option to control creation and send of link previews in setting screen" }, "linkPreviewsDescription": { "message": - "Enable local link previews (Restart for changes to take effect)", + "Previews are supported for Imgur, Instagram, Reddit, and YouTube links.", "description": "Additional detail provided for Link Previews option in settings screen" }, + "linkPreviewsSettingDescription": { + "message": + "Enable local link previews (Restart for changes to take effect).", + "description": "Description shown for the Link Preview option " + }, "spellCheckDescription": { "message": "Enable spell check of text entered in message composition box", "description": "Description of the media permission description" diff --git a/js/views/settings_view.js b/js/views/settings_view.js index 87e93fbb6..9cadfc4b3 100644 --- a/js/views/settings_view.js +++ b/js/views/settings_view.js @@ -218,8 +218,9 @@ spellCheckHeader: i18n('spellCheck'), spellCheckDescription: i18n('spellCheckDescription'), blockedHeader: 'Blocked Users', - sendLinkPreviews: i18n('sendLinkPreviews'), + linkPreviews: i18n('linkPreviews'), linkPreviewsDescription: i18n('linkPreviewsDescription'), + linkPreviewsSettingDescription: i18n('linkPreviewsSettingDescription'), }; }, onClose() { diff --git a/libtextsecure/sendmessage.js b/libtextsecure/sendmessage.js index b8e2ff991..98b6cb086 100644 --- a/libtextsecure/sendmessage.js +++ b/libtextsecure/sendmessage.js @@ -308,10 +308,11 @@ MessageSender.prototype = { const silent = false; // Remove this when we add support for attachments - message.attachmentPointers = null; - message.preview = null; + message.attachments = []; + message.attachmentPointers = []; + message.preview = []; if (message.quote) { - message.quote.attachments = null; + message.quote.attachments = []; } return Promise.all([ diff --git a/settings.html b/settings.html index f7aef778d..cca9fea8d 100644 --- a/settings.html +++ b/settings.html @@ -98,11 +98,16 @@ - +
+

{{ linkPreviews }}

+
{{ linkPreviewsDescription }}
+
+ +

{{ permissions }}