From 76b847091593669c8a7e38918267d6be97dbd4d0 Mon Sep 17 00:00:00 2001 From: Andre Heinecke Date: Wed, 4 Jul 2018 11:13:26 +0200 Subject: [PATCH] json: Add keylist mode locate * src/gpgme-json.c (op_keylist, hlp_keylist): Add locate. -- The same rationale for the KEYLIST_MODE_LOCATE in GPGME also applies here. It makes the API a little less magic. --- src/gpgme-json.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/gpgme-json.c b/src/gpgme-json.c index d7e1cbc6..8d534c67 100644 --- a/src/gpgme-json.c +++ b/src/gpgme-json.c @@ -2125,6 +2125,7 @@ static const char hlp_keylist[] = "tofu: Add KEYLIST_MODE_WITH_TOFU.\n" "ephemeral: Add KEYLIST_MODE_EPHEMERAL.\n" "validate: Add KEYLIST_MODE_VALIDATE.\n" + "locate: Add KEYLIST_MODE_LOCATE.\n" "\n" "Response on success:\n" "keys: Array of keys.\n" @@ -2290,6 +2291,11 @@ op_keylist (cjson_t request, cjson_t result) if (abool) mode |= GPGME_KEYLIST_MODE_VALIDATE; + if ((err = get_boolean_flag (request, "locate", 0, &abool))) + goto leave; + if (abool) + mode |= GPGME_KEYLIST_MODE_LOCATE; + if (!mode) { /* default to local */