[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] externals/openpgp 351de694f7 14/30: Added further checks to openp
From: |
ELPA Syncer |
Subject: |
[elpa] externals/openpgp 351de694f7 14/30: Added further checks to openpgp--upload-callback |
Date: |
Sun, 26 Mar 2023 10:59:27 -0400 (EDT) |
branch: externals/openpgp
commit 351de694f7328edd6281ce0610ac50e38c88e8a5
Author: Philip Kaludercic <philip.kaludercic@fau.de>
Commit: Philip Kaludercic <philip.kaludercic@fau.de>
Added further checks to openpgp--upload-callback
---
openpgp.el | 21 ++++++++++++++++-----
1 file changed, 16 insertions(+), 5 deletions(-)
diff --git a/openpgp.el b/openpgp.el
index a7fb448b67..175f143576 100644
--- a/openpgp.el
+++ b/openpgp.el
@@ -1,4 +1,4 @@
-;;; $Id: openpgp.el,v 1.12 2020/03/05 13:28:41 oj14ozun Exp oj14ozun $
+;;; $Id: openpgp.el,v 1.13 2020/03/05 13:30:16 oj14ozun Exp oj14ozun $
;;; Implementation of the keys.openpgp.org protocol as specified by
;;; https://keys.openpgp.org/about/api
@@ -99,10 +99,21 @@ TOKEN should be supplied by a previous \"upload-key\"
request."
(caddr (assq (caddr (plist-get status :error))
url-http-codes))))
(forward-paragraph)
- (let ((data (json-read)))
- (when (assq 'error data)
- (error "Error in response: %s" (cdr (assq 'error data))))
- (openpgp-request-verify email (cdr (assq 'token data)))))
+ (let* ((json-object-type 'hash-table)
+ (data (json-read)))
+ (when (gethash "error" data)
+ (error "Error in response: %s" (gethash "error" data)))
+ (let ((resp (gethash email (gethash "status" data))))
+ (when (cond ((null resp)
+ (yes-or-no-p "Your address hasn't been recognised by the
server, are you sure you want to proceed?"))
+ ((string= resp "published")
+ (yes-or-no-p "Key has already been published, are you sure
you want to proceed?"))
+ ((string= resp "revoked")
+ (yes-or-no-p "Key has been revoked, are you sure you want to
proceed?"))
+ ((string= resp " pending")
+ (yes-or-no-p "Key is already pending, are you sure you want
to proceed?"))
+ (t t))
+ (openpgp-request-verify email (cdr (assq 'token data)))))))
(defun openpgp-upload-key-string (email key)
"Upload KEY for address EMAIL to keyserver.
- [elpa] externals/openpgp 2a31092a2f 27/30: Add a .gitignore file, (continued)
- [elpa] externals/openpgp 2a31092a2f 27/30: Add a .gitignore file, ELPA Syncer, 2023/03/26
- [elpa] externals/openpgp 671030cb32 01/30: Initial revision, ELPA Syncer, 2023/03/26
- [elpa] externals/openpgp 8d2f94ef37 04/30: Hexify email address when fetching key, ELPA Syncer, 2023/03/26
- [elpa] externals/openpgp 40af1f122e 10/30: Added support for pre-Emacs 27 via json-read, ELPA Syncer, 2023/03/26
- [elpa] externals/openpgp 7742862e4a 20/30: Fix formatting of outline headers, ELPA Syncer, 2023/03/26
- [elpa] externals/openpgp 6d58b73248 28/30: Add a file with the license text, ELPA Syncer, 2023/03/26
- [elpa] externals/openpgp 5d8eb489bc 29/30: Add a README file, ELPA Syncer, 2023/03/26
- [elpa] externals/openpgp e8550d3136 15/30: Fixed indentation in openpgp-mu4e-fetch-key, ELPA Syncer, 2023/03/26
- [elpa] externals/openpgp 59f2277a72 03/30: Added rmail and mu4e integration functions, ELPA Syncer, 2023/03/26
- [elpa] externals/openpgp 63571ea6f9 08/30: Improved openpgp--verify-callback message generation, ELPA Syncer, 2023/03/26
- [elpa] externals/openpgp 351de694f7 14/30: Added further checks to openpgp--upload-callback,
ELPA Syncer <=
- [elpa] externals/openpgp f21d692370 25/30: Add autoload cookies, ELPA Syncer, 2023/03/26
- [elpa] externals/openpgp 44b4e285af 18/30: Add missing "openpgp" group, ELPA Syncer, 2023/03/26
- [elpa] externals/openpgp 25babb1060 30/30: Bump version to 1.0.1 for GNU ELPA, ELPA Syncer, 2023/03/26
- [elpa] externals/openpgp 436edee59b 05/30: Added missing require statments, ELPA Syncer, 2023/03/26