]> git.eshelyaron.com Git - emacs.git/commitdiff
net/nsm.el: Use `gnutls-peer-status-warning-describe'.
authorTed Zlatanov <tzz@lifelogs.com>
Tue, 25 Nov 2014 14:09:11 +0000 (09:09 -0500)
committerTed Zlatanov <tzz@lifelogs.com>
Tue, 25 Nov 2014 14:09:11 +0000 (09:09 -0500)
* net/nsm.el (nsm-check-tls-connection, nsm-save-host)
(nsm-warnings-ok-p): Use `gnutls-peer-status-warning-describe'.

lisp/ChangeLog
lisp/net/nsm.el

index d4f1dbd21770b4522bcb539c82cf1a9f3f3cb3f0..81e28726209f8b7d09f6aa52c70c0ef17978b370 100644 (file)
@@ -1,3 +1,8 @@
+2014-11-25  Teodor Zlatanov  <tzz@lifelogs.com>
+
+       * net/nsm.el (nsm-check-tls-connection, nsm-save-host)
+       (nsm-warnings-ok-p): Use `gnutls-peer-status-warning-describe'.
+
 2014-11-20  Nicolas Richard  <theonewiththeevillook@yahoo.fr>
 
        * emacs-lisp/byte-run.el (function-put): Match argument names to
index fdbcd13d3eed8f41d76525fb81e2bfa7d0017760..35edd07fb6d373d075764720a141fa2416609dd0 100644 (file)
@@ -169,7 +169,9 @@ unencrypted."
                       host port
                       (if (> (length warnings) 1)
                           "s" "")
-                      (mapconcat 'cadr warnings "\n"))))
+                      (mapconcat #'gnutls-peer-status-warning-describe
+                                  warnings
+                                  "\n"))))
            (progn
              (delete-process process)
              nil)
@@ -298,7 +300,7 @@ unencrypted."
        (nconc saved `(:conditions (:unencrypted))))
        ((plist-get status :warnings)
        (nconc saved
-              `(:conditions ,(mapcar 'car (plist-get status :warnings)))))))
+              `(:conditions ,(plist-get status :warnings))))))
     (if (eq permanency 'always)
        (progn
          (nsm-remove-temporary-setting id)
@@ -340,12 +342,9 @@ unencrypted."
     result))
 
 (defun nsm-warnings-ok-p (status settings)
-  (let ((not-ok nil)
-       (conditions (plist-get settings :conditions)))
-    (dolist (warning (plist-get status :warnings))
-      (when (memq (car warning) conditions)
-       (setq not-ok t)))
-    not-ok))
+  (null (cl-intersection
+         (plist-get settings :conditions)
+         (plist-get status :warnings))))
 
 (defun nsm-remove-permanent-setting (id)
   (setq nsm-permanent-host-settings