>From e804e5c160b8ee1fa1ad2e1af7bcf3dd694cd14b Mon Sep 17 00:00:00 2001 From: "F. Jason Park" Date: Sat, 20 Nov 2021 23:53:49 -0800 Subject: NOT A PATCH F. Jason Park (1): Fall back on dialed server names in erc-join lisp/erc/erc-join.el | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) Interdiff: diff --git a/lisp/erc/erc-join.el b/lisp/erc/erc-join.el index 1a6bdedc98..887c40a00c 100644 --- a/lisp/erc/erc-join.el +++ b/lisp/erc/erc-join.el @@ -105,9 +105,9 @@ erc-autojoin-domain-only This is important for networks that redirect you to other 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." +This treatment will only be applied to so-called \"announced\" names, +like zirconium.libera.chat, but not to \"dialed\" names, like +209.51.188.117 or my.vps.example.net." :type 'boolean) (defvar-local erc--autojoin-timer nil) @@ -131,7 +131,7 @@ erc-autojoin-server-match This should be a key from `erc-autojoin-channels-alist'." (or (eq candidate (erc-network)) (and (stringp candidate) - (or (and erc-server-announced-name ; unnecessary after #48598 + (or (and erc-server-announced-name (string-match-p candidate erc-server-announced-name)) (string-match-p candidate erc-session-server))))) @@ -188,12 +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'." - (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)) + (let ((server erc-server-announced-name)) + (if (and erc-autojoin-domain-only + server + (string-match "[^.\n]+\\.\\([^.\n]+\\.[^.\n]+\\)$" server)) + (match-string 1 server) + erc-session-server))) (defun erc-autojoin-add (proc parsed) "Add the channel being joined to `erc-autojoin-channels-alist'." -- 2.31.1