diff options
author | Ruben Pollan <meskio@sindominio.net> | 2017-06-15 11:27:32 +0200 |
---|---|---|
committer | Ruben Pollan <meskio@sindominio.net> | 2017-06-15 11:27:32 +0200 |
commit | fe67a55d8744aede22f69b53b5ce0b983a3f4823 (patch) | |
tree | 6e677cda78795f157aabed3ec40d85e92d7525dd /ui | |
parent | 69e4fb92bad4bb593d59cfe29eb51d238e0fd8db (diff) |
[feat] Add a 'fetch' flag to key export
If is set keyamanger will try to discover and download the key.
- Resolves: #8821
Diffstat (limited to 'ui')
-rw-r--r-- | ui/app/lib/bitmask.js | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/ui/app/lib/bitmask.js b/ui/app/lib/bitmask.js index 9d77224..72c027c 100644 --- a/ui/app/lib/bitmask.js +++ b/ui/app/lib/bitmask.js @@ -359,11 +359,17 @@ var bitmask = function(){ * @param {string} address The email address of the key * @param {boolean} priv Should get the private key? * If it's not provided the public one will be fetched. + * @param {boolean} fetch If the key is not in keymanager, should we fetch it remotely. + * If it's not provided keys will not be fetched remotely * * @return {Promise<KeyObject>} The key */ - exprt: function(uid, address, priv) { - return call(['keys', 'export', uid, address, private_str(priv)]); + exprt: function(uid, address, priv, fetch) { + var privstr = private_str(priv); + if ((typeof fetch === 'bool') && fetch) { + privstr = 'fetch'; + } + return call(['keys', 'export', uid, address, privstr]); }, /** |