summaryrefslogtreecommitdiff
path: root/lisp/erc/erc.el
diff options
context:
space:
mode:
authorF. Jason Park <jp@neverwas.me>2022-12-02 23:11:24 -0800
committerF. Jason Park <jp@neverwas.me>2022-12-14 06:40:55 -0800
commit0155fc67be393239e5a2956d5dfaf6a0f74b517e (patch)
treec36c226ef68dad55b76648ab97724a0f20de84fa /lisp/erc/erc.el
parent9ac80e8a6e4969cfe88d5233dc4152bbfa46c848 (diff)
downloademacs-0155fc67be393239e5a2956d5dfaf6a0f74b517e.tar.gz
Respect a nil erc-session-password when reconnecting
* lisp/erc/erc.el (erc-open): Simplify `old-vars' expression. (erc--compute-server-password): Only compute a server password when first connecting. For compatibility, this respects third-party code that expects session passwords in target buffers when initially non-nil. * test/lisp/erc/erc-scenarios-services-misc.el (erc-scenarios-services-auth-source-reconnect): Add new test. * test/lisp/erc/resources/services/auth-source/recon.eld: Add new test data file. (Bug#59858.)
Diffstat (limited to 'lisp/erc/erc.el')
-rw-r--r--lisp/erc/erc.el4
1 files changed, 3 insertions, 1 deletions
diff --git a/lisp/erc/erc.el b/lisp/erc/erc.el
index 3b0cde41558..7e7e142b854 100644
--- a/lisp/erc/erc.el
+++ b/lisp/erc/erc.el
@@ -1970,7 +1970,7 @@ Returns the buffer for the given server or channel."
(let* ((target (and channel (erc--target-from-string channel)))
(buffer (erc-get-buffer-create server port nil target id))
(old-buffer (current-buffer))
- (old-vars (and (not connect) (buffer-local-variables)))
+ (old-vars (and target (buffer-local-variables)))
(old-recon-count erc-server-reconnect-count)
(old-point nil)
(delayed-modules nil)
@@ -6451,6 +6451,8 @@ non-nil value is found.
When `erc-auth-source-server-function' is non-nil, call it with NICK for
the user field and use whatever it returns as the server password."
(or password (and erc-auth-source-server-function
+ (not erc--server-reconnecting)
+ (not erc--target)
(funcall erc-auth-source-server-function :user nick))))
(defun erc-compute-full-name (&optional full-name)