[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] externals/openpgp 63571ea6f9 08/30: Improved openpgp--verify-call
From: |
ELPA Syncer |
Subject: |
[elpa] externals/openpgp 63571ea6f9 08/30: Improved openpgp--verify-callback message generation |
Date: |
Sun, 26 Mar 2023 10:59:27 -0400 (EDT) |
branch: externals/openpgp
commit 63571ea6f9ddf4f9013738b86349f1850c2b1497
Author: Philip Kaludercic <philip.kaludercic@fau.de>
Commit: Philip Kaludercic <philip.kaludercic@fau.de>
Improved openpgp--verify-callback message generation
---
openpgp.el | 25 ++++++++++++++++++-------
1 file changed, 18 insertions(+), 7 deletions(-)
diff --git a/openpgp.el b/openpgp.el
index b730c499e1..c09cbd2091 100644
--- a/openpgp.el
+++ b/openpgp.el
@@ -1,4 +1,4 @@
-;;; $Id: openpgp.el,v 1.6 2020/03/04 18:01:30 oj14ozun Exp oj14ozun $
+;;; $Id: openpgp.el,v 1.7 2020/03/05 12:31:50 oj14ozun Exp oj14ozun $
;;; Implementation of the keys.openpgp.org protocol as specified by
;;; https://keys.openpgp.org/about/api
@@ -51,16 +51,26 @@ URL, if non-nil."
;; UPLOADING KEYS
-(defun openpgp--verify-callback (status)
+(defun openpgp--verify-callback (status email)
(when (plist-get status :error)
(error "Request failed: %s"
(caddr (assq (caddr (plist-get status :error))
url-http-codes))))
(forward-paragraph)
- (let ((data (json-parse-buffer :object-type 'alist)))
- (when (assq 'error data)
- (error "Error in response: %s" (cdr (assq 'error data))))
- (message "Verification successfully requested.")))
+ (let ((data (json-parse-buffer)))
+ (when (gethash "error" data)
+ (error "Error in response: %s" (gethash "error" data)))
+ (let ((resp (gethash email (gethash "status" data))))
+ (cond ((null resp)
+ (message "Verification request might have failed. Are you using
the correct address?"))
+ ((string= resp "unpublished")
+ (message "Verification request might have failed. Are you using
the correct key?"))
+ ((string= resp "published")
+ (message "Verification request succeeded, but key has already been
published."))
+ ((string= resp "revoked")
+ (message "Verification request succeeded, but key has been
revoked."))
+ ((string= resp " pending")
+ (message "Verification request succeeded, a email should arrive
soon."))))))
(defun openpgp-request-verify (email token)
"Request verification email for address EMAIL.
@@ -71,7 +81,8 @@ TOKEN should be supplied by a previous \"upload-key\"
request."
(url-request-data (json-encode `(("token" . ,token)
("addresses" . (,email))))))
(url-retrieve (openpgp--api-url "request-verify")
- #'openpgp--verify-callback)))
+ #'openpgp--verify-callback
+ (list email))))
(defun openpgp--upload-callback (status email)
(when (plist-get status :error)
- [elpa] externals/openpgp a311c89f17 23/30: Add missing docstrings, (continued)
- [elpa] externals/openpgp a311c89f17 23/30: Add missing docstrings, ELPA Syncer, 2023/03/26
- [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 <=
- [elpa] externals/openpgp 351de694f7 14/30: Added further checks to openpgp--upload-callback, ELPA Syncer, 2023/03/26
- [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