emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

feature/rcirc-update c6b6c2d 02/18: Use auth-source for user-passwords


From: Philip Kaludercic
Subject: feature/rcirc-update c6b6c2d 02/18: Use auth-source for user-passwords
Date: Thu, 10 Jun 2021 11:43:37 -0400 (EDT)

branch: feature/rcirc-update
commit c6b6c2d59626e3849691eb1ce747b33e43927ef2
Author: Philip Kaludercic <philipk@posteo.net>
Commit: Philip Kaludercic <philipk@posteo.net>

    Use auth-source for user-passwords
    
    * (rcirc): Use auth-source is no password was specifed
---
 lisp/net/rcirc.el | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/lisp/net/rcirc.el b/lisp/net/rcirc.el
index 90b61ba..67dcf3e 100644
--- a/lisp/net/rcirc.el
+++ b/lisp/net/rcirc.el
@@ -44,6 +44,7 @@
 (require 'cl-lib)
 (require 'ring)
 (require 'time-date)
+(require 'auth-source)
 (eval-when-compile (require 'subr-x))
 
 (defconst rcirc-id-string (concat "rcirc on GNU Emacs " emacs-version))
@@ -500,6 +501,12 @@ If ARG is non-nil, instead prompt for connection 
parameters."
               (encryption (plist-get (cdr c) :encryption))
               (server-alias (plist-get (cdr c) :server-alias))
               contact)
+          (when-let (((not password))
+                     (auth (auth-source-search :host server
+                                               :user user-name
+                                               :port port))
+                     (fn (plist-get (car auth) :secret)))
+            (setq password (funcall fn)))
          (when server
            (let (connected)
              (dolist (p (rcirc-process-list))



reply via email to

[Prev in Thread] Current Thread [Next in Thread]