diff options
author | Ruben Pollan <meskio@sindominio.net> | 2017-08-02 00:05:25 +0200 |
---|---|---|
committer | Ruben Pollan <meskio@sindominio.net> | 2017-08-02 00:05:25 +0200 |
commit | c49293b7f3eff7a478fc388768366e7b025f7da0 (patch) | |
tree | 00e205a21f9541f5bd4debd57136eee9ecfdfcc8 /web-ui/app/js/mail_view/ui | |
parent | ccb4f03fe5854793742bed68ee5a83c343899ee1 (diff) |
[feat] Display mixnet status on outgoing emails
Diffstat (limited to 'web-ui/app/js/mail_view/ui')
-rw-r--r-- | web-ui/app/js/mail_view/ui/recipients/recipient.js | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/web-ui/app/js/mail_view/ui/recipients/recipient.js b/web-ui/app/js/mail_view/ui/recipients/recipient.js index c13a52b1..19866108 100644 --- a/web-ui/app/js/mail_view/ui/recipients/recipient.js +++ b/web-ui/app/js/mail_view/ui/recipients/recipient.js @@ -89,6 +89,25 @@ define( }.bind(this)); }; + this.discoverMixnet = function () { + var p = $.getJSON('/mixnet?search=' + this.attr.address).promise(); + p.done(function (stat) { + switch (stat.status) { + case 'ok': + this.$node.find('.recipient-mixnet').addClass('mixnet'); + break; + case 'unsuported': + this.$node.find('.recipient-mixnet').addClass('unsuported-mixnet'); + break; + default: + this.$node.find('.recipient-mixnet').addClass('not-mixnet'); + } + }.bind(this)); + p.fail(function () { + this.$node.find('.recipient-mixnet').addClass('not-mixnet'); + }.bind(this)); + }; + this.getMailAddress = function() { return this.$node.find('input[type=hidden]').val(); }; @@ -105,6 +124,7 @@ define( this.sinalizeInvalid(); } else { this.discoverEncryption(); + this.discoverMixnet(); } }); } |