From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: "J.P." Newsgroups: gmane.emacs.bugs Subject: bug#52010: 28.0.60; ERC now ignores dialed server names in autojoin Date: Sun, 21 Nov 2021 03:31:03 -0800 Message-ID: <87bl2d7nk8.fsf__16950.9700428293$1637494338$gmane$org@neverwas.me> References: <87ilwmbbz7.fsf@neverwas.me> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="28579"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.60 (gnu/linux) Cc: emacs-erc@gnu.org To: 52010@debbugs.gnu.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Sun Nov 21 12:32:10 2021 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1mol4s-0007FA-8h for geb-bug-gnu-emacs@m.gmane-mx.org; Sun, 21 Nov 2021 12:32:10 +0100 Original-Received: from localhost ([::1]:34564 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mol4q-0007Pg-Vw for geb-bug-gnu-emacs@m.gmane-mx.org; Sun, 21 Nov 2021 06:32:09 -0500 Original-Received: from eggs.gnu.org ([209.51.188.92]:43280) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mol4l-0007PW-3M for bug-gnu-emacs@gnu.org; Sun, 21 Nov 2021 06:32:03 -0500 Original-Received: from debbugs.gnu.org ([209.51.188.43]:32786) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1mol4k-0002vn-Ha for bug-gnu-emacs@gnu.org; Sun, 21 Nov 2021 06:32:02 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1mol4k-0004W7-Az for bug-gnu-emacs@gnu.org; Sun, 21 Nov 2021 06:32:02 -0500 X-Loop: help-debbugs@gnu.org Resent-From: "J.P." Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sun, 21 Nov 2021 11:32:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 52010 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch Original-Received: via spool by 52010-submit@debbugs.gnu.org id=B52010.163749427717301 (code B ref 52010); Sun, 21 Nov 2021 11:32:02 +0000 Original-Received: (at 52010) by debbugs.gnu.org; 21 Nov 2021 11:31:17 +0000 Original-Received: from localhost ([127.0.0.1]:44332 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mol41-0004Uy-9W for submit@debbugs.gnu.org; Sun, 21 Nov 2021 06:31:17 -0500 Original-Received: from mail-108-mta174.mxroute.com ([136.175.108.174]:44487) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mol3y-0004Uj-FS for 52010@debbugs.gnu.org; Sun, 21 Nov 2021 06:31:15 -0500 Original-Received: from filter004.mxroute.com ([149.28.56.236] filter004.mxroute.com) (Authenticated sender: mN4UYu2MZsgR) by mail-108-mta174.mxroute.com (ZoneMTA) with ESMTPSA id 17d42439d19000177f.001 for <52010@debbugs.gnu.org> (version=TLSv1/SSLv3 cipher=ECDHE-RSA-AES128-GCM-SHA256); Sun, 21 Nov 2021 11:31:07 +0000 X-Zone-Loop: 011d7d843c5add341725cb7f12456c0a92ad6c2f454e X-Originating-IP: [149.28.56.236] DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=neverwas.me ; s=x; h=Content-Type:MIME-Version:Message-ID:In-Reply-To:Date:References: Subject:Cc:To:From:Sender:Reply-To:Content-Transfer-Encoding:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Id:List-Help:List-Unsubscribe:List-Subscribe: List-Post:List-Owner:List-Archive; bh=XJMszF1gGloYNM4nmvTE4+aHH0jdFHWXTGsu2MNLenk=; b=mn7ihnY+D8Oo7EtZQ0HTRYPvFA ZiKygrUhmJcEWZN7NIeHdicBIhtvrcTG5esusHcyh6ccFgXU2Ih7s9Kg2P24B6MM6b215/NV1w+CO ARq5y/W68d3DzPTX3K2xoVtoN6HDntoyvg4jjNjwsDoTpRk3xectOcbInd5Nq6HT27Pvik3RNjRxl 06j7yHlxFBqa/G5JDr/vqaCcA40xvHqTGebcbarzrzYroQRb2ma4QlgA59nYzAg3+2gD4gEsPJ5mD vy9aKA6nM7x45MLuVLxPzANRqGOUKc7MVXLOH/oTON1X5CYYw2xaswwCAJLTlsEmkPhpjoyk+RYgy 07fUjfhQ==; In-Reply-To: <87ilwmbbz7.fsf@neverwas.me> (J. P.'s message of "Sat, 20 Nov 2021 16:15:24 -0800") X-AuthUser: masked@neverwas.me X-Zone-Spam-Resolution: no action X-Zone-Spam-Status: No, score=-0.1, required=15, tests=[ARC_NA=0, RCPT_COUNT_TWO=0, FROM_HAS_DN=0, HAS_ATTACHMENT=0, FROM_EQ_ENVFROM=0, MIME_TRACE=0, MIME_GOOD=-0.1, TO_DN_NONE=0, MID_RHS_MATCH_FROM=0, RCVD_COUNT_ZERO=0, NEURAL_SPAM=0] X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.io gmane.emacs.bugs:220555 Archived-At: --=-=-= Content-Type: text/plain v2: a small tweak to leave a tidier footprint for git-blame. Also, some slight corrections on the timeline: Jan 20, 2003 - Register autojoin function with `erc-after-connect' hook, which passes in `erc-announced-server-name' for function's server param Jun 26, 2005 - Add dialed server as fallback when announced name missing Sep 16, 2005 - Deprecate `erc-announced-server-name' in favor of `erc-server-announced-name' Jan 05, 2017 - Switch from announced to dialed, ignoring server param provided by `erc-after-connect' hook Sep 16, 2021 - Switch from dialed to announced, but consider networks This patch - Stay the course, but always fall back to dialed (not just when unset) Bug #48598 - Prefer unique session identifiers based around and compatible with networks, but fall back on announced, then dialed (for compatibility) --=-=-= Content-Type: text/x-patch Content-Disposition: attachment; filename=0000-v1-v2.diff >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 --=-=-= Content-Type: text/x-patch Content-Disposition: attachment; filename=0001-Fall-back-on-dialed-server-names-in-erc-join.patch >From e804e5c160b8ee1fa1ad2e1af7bcf3dd694cd14b Mon Sep 17 00:00:00 2001 From: "F. Jason Park" Date: Wed, 10 Nov 2021 23:42:42 -0800 Subject: [PATCH 1/1] 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 argument 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 | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) diff --git a/lisp/erc/erc-join.el b/lisp/erc/erc-join.el index 2ed8622b85..887c40a00c 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\" names, like +209.51.188.117 or my.vps.example.net." :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 + (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))) + (let ((server erc-server-announced-name)) (if (and erc-autojoin-domain-only + server (string-match "[^.\n]+\\.\\([^.\n]+\\.[^.\n]+\\)$" server)) (match-string 1 server) - server))) + erc-session-server))) (defun erc-autojoin-add (proc parsed) "Add the channel being joined to `erc-autojoin-channels-alist'." -- 2.31.1 --=-=-=--