UX: Do not enable encryption by default for new messages.

UX: Do not enable encryption by default for new messages.

diff --git a/assets/javascripts/discourse/connectors/composer-action-after/encrypt.hbs b/assets/javascripts/discourse/connectors/composer-action-after/encrypt.hbs
index 2b1d159..e6b8d00 100644
--- a/assets/javascripts/discourse/connectors/composer-action-after/encrypt.hbs
+++ b/assets/javascripts/discourse/connectors/composer-action-after/encrypt.hbs
@@ -1,7 +1,7 @@
 {{#if (or model.creatingPrivateMessage model.topic.encrypted_title)}}
   {{#if isEncryptActive}}
     <a {{action clicked}} title={{i18n title}}>
-      {{d-icon (if model.isEncrypted "lock" "unlock") class=(if model.disableEncryptIndicator "disabled")}}
+      {{d-icon (if model.isEncrypted "lock" "unlock") class=(concat (if model.isEncrypted "enabled ") (if model.disableEncryptIndicator "disabled"))}}
     </a>
 
     {{#if model.showEncryptError}}
diff --git a/assets/javascripts/discourse/initializers/hook-composer.js.es6 b/assets/javascripts/discourse/initializers/hook-composer.js.es6
index 9085807..2f0542a 100644
--- a/assets/javascripts/discourse/initializers/hook-composer.js.es6
+++ b/assets/javascripts/discourse/initializers/hook-composer.js.es6
@@ -88,17 +88,10 @@ export default {
             }
           }
 
-          // Automatically enable encryption so people do not forget, but
-          // remember user preferences. If user enters a recipient, unchecks
-          // encryption and then adds another recipient, this will not revert
-          // his uncheck.
-          if (this.disableEncryptIndicator) {
-            this.setProperties({
-              isEncrypted: true,
-              disableEncryptIndicator: false,
-              encryptError: ""
-            });
-          }
+          this.setProperties({
+            disableEncryptIndicator: false,
+            encryptError: ""
+          });
         });
       }
     });
diff --git a/assets/stylesheets/common/encrypt.scss b/assets/stylesheets/common/encrypt.scss
index 10f191b..f8ab918 100644
--- a/assets/stylesheets/common/encrypt.scss
+++ b/assets/stylesheets/common/encrypt.scss
@@ -64,6 +64,9 @@ pre.exported-keypair {
   .reply-to {
     .d-icon {
       margin: 0 5px;
+      &.enabled {
+        color: $success;
+      }
       &.disabled {
         color: $primary-low-mid;
       }
diff --git a/config/locales/client.en.yml b/config/locales/client.en.yml
index 26bcd49..c47d9cf 100644
--- a/config/locales/client.en.yml
+++ b/config/locales/client.en.yml
@@ -26,7 +26,7 @@ en:
 
       composer:
         encrypt: "Encrypt message?"
-        user_has_no_key: "Unfortunately {{username}} cannot be added to this message because they have not enabled encrypted messages in their preferences."
+        user_has_no_key: "Unfortunately {{username}} did not enable encrypted messages."
 
       preferences:
         status_enabled: "You have enabled encryption and activated it on this device."

GitHub sha: 733a936b

1 Like