DEV: Prefer ES5 getters.

DEV: Prefer ES5 getters.

diff --git a/assets/javascripts/discourse/connectors/composer-action-after/encrypt.js.es6 b/assets/javascripts/discourse/connectors/composer-action-after/encrypt.js.es6
index e593500..d866edb 100644
--- a/assets/javascripts/discourse/connectors/composer-action-after/encrypt.js.es6
+++ b/assets/javascripts/discourse/connectors/composer-action-after/encrypt.js.es6
@@ -21,12 +21,12 @@ export default {
 
       didInsertElement() {
         this._super(...arguments);
-        this.appEvents.on("encrypt:status-changed", this.get("listener"));
+        this.appEvents.on("encrypt:status-changed", this.listener);
       },
 
       willDestroyElement() {
         this._super(...arguments);
-        this.appEvents.off("encrypt:status-changed", this.get("listener"));
+        this.appEvents.off("encrypt:status-changed", this.listener);
       },
 
       clicked() {
diff --git a/assets/javascripts/discourse/connectors/user-preferences-account/encrypt.js.es6 b/assets/javascripts/discourse/connectors/user-preferences-account/encrypt.js.es6
index 80277e9..d509852 100644
--- a/assets/javascripts/discourse/connectors/user-preferences-account/encrypt.js.es6
+++ b/assets/javascripts/discourse/connectors/user-preferences-account/encrypt.js.es6
@@ -34,7 +34,7 @@ registerHelper("or", ([a, b]) => a || b);
 export default {
   setupComponent(args, component) {
     const currentUser = Discourse.User.current();
-    if (args.model.get("id") === currentUser.get("id")) {
+    if (args.model.id === currentUser.id) {
       const status = getEncryptionStatus(args.model);
       component.setProperties({
         model: args.model,
@@ -72,19 +72,19 @@ export default {
         },
         didInsertElement() {
           this._super(...arguments);
-          this.appEvents.on("encrypt:status-changed", this.get("listener"));
+          this.appEvents.on("encrypt:status-changed", this.listener);
         },
         willDestroyElement() {
           this._super(...arguments);
-          this.appEvents.off("encrypt:status-changed", this.get("listener"));
+          this.appEvents.off("encrypt:status-changed", this.listener);
         }
       });
       Ember.defineProperty(
         component,
         "passphraseStatus",
         Ember.computed("passphrase", "passphrase2", function() {
-          const passphrase = component.get("passphrase");
-          const passphrase2 = component.get("passphrase2");
+          const passphrase = component.passphrase;
+          const passphrase2 = component.passphrase2;
           if (!passphrase) {
             return "encrypt.preferences.passphrase_enter";
           } else if (passphrase.length < 15) {
@@ -128,8 +128,8 @@ export default {
 
       // 1. Generate new key pair or import existing one.
       let keyPairPromise;
-      if (this.get("importKey")) {
-        const str = (this.get("key") || PACKED_KEY_SEPARATOR)
+      if (this.importKey) {
+        const str = (this.key || PACKED_KEY_SEPARATOR)
           .replace(PACKED_KEY_HEADER, "")
           .replace(PACKED_KEY_FOOTER, "")
           .split(PACKED_KEY_SEPARATOR);
@@ -157,7 +157,7 @@ export default {
         .then(keyPair => {
           const [publicKey, privateKey] = keyPair;
 
-          const passphrase = this.get("passphrase");
+          const passphrase = this.passphrase;
           const salt = generateSalt();
           const publicStr = exportPublicKey(publicKey);
           const privateStr = generatePassphraseKey(passphrase, salt).then(
@@ -189,8 +189,8 @@ export default {
         .then(([publicStr, privateStr, salt]) =>
           Ember.RSVP.Promise.all([
             importPublicKey(publicStr),
-            generatePassphraseKey(this.get("passphrase"), salt).then(
-              passphraseKey => importPrivateKey(privateStr, passphraseKey)
+            generatePassphraseKey(this.passphrase, salt).then(passphraseKey =>
+              importPrivateKey(privateStr, passphraseKey)
             )
           ])
         )
@@ -223,7 +223,7 @@ export default {
       const publicStr = this.get("model.custom_fields.encrypt_public_key");
       const privateStr = this.get("model.custom_fields.encrypt_private_key");
       const salt = this.get("model.custom_fields.encrypt_salt");
-      const passphrase = this.get("passphrase");
+      const passphrase = this.passphrase;
 
       // 1. a. Import public key from string.
       // 1. b. Import private from string (using passphrase).
@@ -261,9 +261,9 @@ export default {
       const oldPublicStr = this.get("model.custom_fields.encrypt_public_key");
       const oldPrivateStr = this.get("model.custom_fields.encrypt_private_key");
       const oldSalt = this.get("model.custom_fields.encrypt_salt");
-      const oldPassphrase = this.get("oldPassphrase");
+      const oldPassphrase = this.oldPassphrase;
       const salt = generateSalt();
-      const passphrase = this.get("passphrase");
+      const passphrase = this.passphrase;
 
       // 1. a. Decrypt private key with old passphrase.
       // 1. b. Generate new passphrase key.
@@ -314,11 +314,11 @@ export default {
     },
 
     export() {
-      showModal("export-keypair").set("model", this.get("model"));
+      showModal("export-keypair").set("model", this.model);
     },
 
     reset() {
-      showModal("reset-keypair").set("model", this.get("model"));
+      showModal("reset-keypair").set("model", this.model);
     }
   }
 };
diff --git a/assets/javascripts/discourse/controllers/activate-encrypt.js.es6 b/assets/javascripts/discourse/controllers/activate-encrypt.js.es6
index b41ca25..c550e4a 100644
--- a/assets/javascripts/discourse/controllers/activate-encrypt.js.es6
+++ b/assets/javascripts/discourse/controllers/activate-encrypt.js.es6
@@ -8,8 +8,8 @@ import { saveKeyPairToIndexedDb } from "discourse/plugins/discourse-encrypt/lib/
 
 export default Ember.Controller.extend(ModalFunctionality, {
   onShow() {
-    const models = this.get("models") || [];
-    models.push(this.get("model"));
+    const models = this.models || [];
+    models.push(this.model);
 
     this.setProperties({
       models: models,
@@ -19,7 +19,7 @@ export default Ember.Controller.extend(ModalFunctionality, {
   },
 
   onClose() {
-    const models = this.get("models") || [];
+    const models = this.models || [];
     models.forEach(model => {
       model.state.decrypting = false;
       model.state.decrypted = true;
@@ -36,7 +36,7 @@ export default Ember.Controller.extend(ModalFunctionality, {
       const publicStr = user.get("custom_fields.encrypt_public_key");
       const privateStr = user.get("custom_fields.encrypt_private_key");
       const salt = user.get("custom_fields.encrypt_salt");
-      const passphrase = this.get("passphrase");
+      const passphrase = this.passphrase;
 
       // 1. a. Import public key from string.
       // 1. b. Import private from string (using passphrase).
@@ -55,7 +55,7 @@ export default Ember.Controller.extend(ModalFunctionality, {
         // 3. Reset component status.
         .then(() => {
           this.appEvents.trigger("encrypt:status-changed");
-          this.get("models").forEach(model => model.scheduleRerender());
+          this.models.forEach(model => model.scheduleRerender());
           this.set("models", null);
           this.send("closeModal");
         })
diff --git a/assets/javascripts/discourse/controllers/export-keypair.js.es6 b/assets/javascripts/discourse/controllers/export-keypair.js.es6
index 040f0d1..0b215bf 100644
--- a/assets/javascripts/discourse/controllers/export-keypair.js.es6
+++ b/assets/javascripts/discourse/controllers/export-keypair.js.es6
@@ -44,11 +44,11 @@ export default Ember.Controller.extend(ModalFunctionality, {
     export() {
       this.set("inProgress", true);
 
-      const user = this.get("model");
+      const user = this.model;
       const publicStr = user.get("custom_fields.encrypt_public_key");
       const privateStr = user.get("custom_fields.encrypt_private_key");

[... diff too long, it was truncated ...]

GitHub sha: 96f0c832