summaryrefslogtreecommitdiff
path: root/web-ui/app/js/mail_view/ui/recipients/recipient.js
diff options
context:
space:
mode:
Diffstat (limited to 'web-ui/app/js/mail_view/ui/recipients/recipient.js')
-rw-r--r--web-ui/app/js/mail_view/ui/recipients/recipient.js20
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();
}
});
}