aboutsummaryrefslogtreecommitdiffstats
path: root/lang/js/src/Connection.js
diff options
context:
space:
mode:
authorMaximilian Krambach <[email protected]>2018-05-25 17:02:18 +0000
committerMaximilian Krambach <[email protected]>2018-05-25 17:02:18 +0000
commit7a73d88aba106d571f121dc3230864c81a76e5db (patch)
tree171dafc5a054a725dafe317fcca7b9d0521637e1 /lang/js/src/Connection.js
parentjs: use version operation for connection checks (diff)
downloadgpgme-7a73d88aba106d571f121dc3230864c81a76e5db.tar.gz
gpgme-7a73d88aba106d571f121dc3230864c81a76e5db.zip
js: implement Key handling (1)
-- * Keys can now be queried for information. Onne version queries gnug directly (asynchronous Promise in javascript terms), the cached version refreshes on demand. * Small fixes: src/Connection.js joins answers that stay json properly now
Diffstat (limited to '')
-rw-r--r--lang/js/src/Connection.js8
1 files changed, 7 insertions, 1 deletions
diff --git a/lang/js/src/Connection.js b/lang/js/src/Connection.js
index 07df5def..3b442622 100644
--- a/lang/js/src/Connection.js
+++ b/lang/js/src/Connection.js
@@ -215,7 +215,13 @@ class Answer{
if (!this._response.hasOwnProperty(key)){
this._response[key] = [];
}
- this._response[key].push(msg[key]);
+ if (Array.isArray(msg[key])) {
+ for (let i=0; i< msg[key].length; i++) {
+ this._response[key].push(msg[key][i]);
+ }
+ } else {
+ this._response[key].push(msg[key][i]);
+ }
}
else {
return gpgme_error('CONN_UNEXPECTED_ANSWER');