diff options
| author | F. Jason Park | 2022-11-23 21:31:19 -0800 |
|---|---|---|
| committer | Amin Bandali | 2022-11-28 23:56:04 -0500 |
| commit | 35e2b8a26be06ac1e563801eeb2193c57fd1189d (patch) | |
| tree | fa180ea6e783e816f54700b1153f50c0cb506fbd /lisp | |
| parent | 7336520fe774f7f7f5209c884e04911514bae796 (diff) | |
| download | emacs-35e2b8a26be06ac1e563801eeb2193c57fd1189d.tar.gz emacs-35e2b8a26be06ac1e563801eeb2193c57fd1189d.zip | |
Add erc-sasl-auth-source-function to cached options
* lisp/erc/erc-sasl.el (erc-sasl--read-password): Consult cached
options instead of `erc-sasl-auth-source-function'.
(erc-sasl--init): Add `erc-sasl-auth-source-function' to
`erc-sasl--options'.
* test/lisp/erc/erc-sasl-tests.el (erc-sasl--read-password--basic,
erc-sasl--read-password--auth-source): Look for original value of
`erc-sasl-auth-source-function' in `erc-sasl--options' under the
`authfn' key.
Diffstat (limited to 'lisp')
| -rw-r--r-- | lisp/erc/erc-sasl.el | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/lisp/erc/erc-sasl.el b/lisp/erc/erc-sasl.el index 9084d873ce4..5ee7169de5f 100644 --- a/lisp/erc/erc-sasl.el +++ b/lisp/erc/erc-sasl.el | |||
| @@ -137,10 +137,11 @@ PROMPT is passed to `read-passwd' if necessary." | |||
| 137 | ((found (pcase (alist-get 'password erc-sasl--options) | 137 | ((found (pcase (alist-get 'password erc-sasl--options) |
| 138 | (:password erc-session-password) | 138 | (:password erc-session-password) |
| 139 | ((and (pred stringp) v) (unless (string-empty-p v) v)) | 139 | ((and (pred stringp) v) (unless (string-empty-p v) v)) |
| 140 | ((and (guard erc-sasl-auth-source-function) | 140 | ((and (let fn (alist-get 'authfn erc-sasl--options)) |
| 141 | v (let host | 141 | (guard fn) v |
| 142 | (or v (erc-networks--id-given erc-networks--id)))) | 142 | (let host |
| 143 | (apply erc-sasl-auth-source-function | 143 | (or v (erc-networks--id-given erc-networks--id)))) |
| 144 | (apply fn | ||
| 144 | :user (erc-sasl--get-user) | 145 | :user (erc-sasl--get-user) |
| 145 | (and host (list :host (symbol-name host)))))))) | 146 | (and host (list :host (symbol-name host)))))))) |
| 146 | (copy-sequence (erc--unfun found)) | 147 | (copy-sequence (erc--unfun found)) |
| @@ -293,6 +294,7 @@ PROMPT is passed to `read-passwd' if necessary." | |||
| 293 | `((user . ,erc-sasl-user) | 294 | `((user . ,erc-sasl-user) |
| 294 | (password . ,erc-sasl-password) | 295 | (password . ,erc-sasl-password) |
| 295 | (mechanism . ,erc-sasl-mechanism) | 296 | (mechanism . ,erc-sasl-mechanism) |
| 297 | (authfn . ,erc-sasl-auth-source-function) | ||
| 296 | (authzid . ,erc-sasl-authzid))))) | 298 | (authzid . ,erc-sasl-authzid))))) |
| 297 | 299 | ||
| 298 | (defun erc-sasl--mechanism-offered-p (offered) | 300 | (defun erc-sasl--mechanism-offered-p (offered) |