>From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: "F. Jason Park" Date: Wed, 10 Nov 2021 23:42:42 -0800 Subject: [PATCH 01/28] Fall back on dialed server names in erc-join * lisp/erc/erc-join.el (erc-autojoin-server-match, erc-autojoin-current-server): as a fallback, always try the original server param passed to `erc-open' when matching against members of `erc-autojoin-channels-alist'. Similarly, when adding and removing items, only apply the `erc-autojoin-domain-only' truncation treatment to "announced" servers. --- lisp/erc/erc-join.el | 23 ++++++++++++++--------- 1 file changed, 14 insertions(+), 9 deletions(-) diff --git a/lisp/erc/erc-join.el b/lisp/erc/erc-join.el index 2ed8622b85..1a6bdedc98 100644 --- a/lisp/erc/erc-join.el +++ b/lisp/erc/erc-join.el @@ -103,7 +103,11 @@ erc-autojoin-domain-only If non-nil, and a channel on the server a.b.c is joined, then only b.c is used as the server for `erc-autojoin-channels-alist'. This is important for networks that redirect you to other -servers, presumably in the same domain." +servers, presumably in the same domain. + +This treatment will only be applied to so-called \"announced names\", +like zirconium.libera.chat, but not to \"dialed\" hostnames, like +my.proxy.localdomain or my.vps.example.com." :type 'boolean) (defvar-local erc--autojoin-timer nil) @@ -127,9 +131,9 @@ erc-autojoin-server-match This should be a key from `erc-autojoin-channels-alist'." (or (eq candidate (erc-network)) (and (stringp candidate) - (string-match-p candidate - (or erc-server-announced-name - erc-session-server))))) + (or (and erc-server-announced-name ; unnecessary after #48598 + (string-match-p candidate erc-server-announced-name)) + (string-match-p candidate erc-session-server))))) (defun erc-autojoin-after-ident (_network _nick) "Autojoin channels in `erc-autojoin-channels-alist'. @@ -184,11 +188,12 @@ erc-autojoin-channels (defun erc-autojoin-current-server () "Compute the current server for lookup in `erc-autojoin-channels-alist'. Respects `erc-autojoin-domain-only'." - (let ((server (or erc-server-announced-name erc-session-server))) - (if (and erc-autojoin-domain-only - (string-match "[^.\n]+\\.\\([^.\n]+\\.[^.\n]+\\)$" server)) - (match-string 1 server) - server))) + (if (and erc-autojoin-domain-only + erc-server-announced-name + (string-match "[^.\n]+\\.\\([^.\n]+\\.[^.\n]+\\)$" + erc-server-announced-name)) + (match-string 1 erc-server-announced-name) + erc-session-server)) (defun erc-autojoin-add (proc parsed) "Add the channel being joined to `erc-autojoin-channels-alist'." -- 2.31.1