emacs-erc
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[PATCH] allow port as string in auth-source params


From: Trevor Arjeski
Subject: [PATCH] allow port as string in auth-source params
Date: Sun, 24 Nov 2024 23:48:07 +0300
User-agent: Gnus/5.13 (Gnus v5.13)

Mentioned in the #erc IRC that I ran into the issue where I had
`erc-port' set as a string instead of an integer and it failed to query
my .authinfo file for the correct entry for my bouncer.

Seem patch commit message for more info, and feel free to ignore since
this is kind of an edge case.

>From 9468a786fb8c0ef950117e78395592f2e11613c2 Mon Sep 17 00:00:00 2001
From: Trevor Arjeski <tmarjeski@gmail.com>
Date: Sun, 24 Nov 2024 23:35:41 +0300
Subject: [PATCH] erc: allow port as string in auth-source params

Checking the equality of the given `erc-session-port' with "irc" is
unnecessary since:

1. "irc" is already added to the list of ports
2. /etc/services may contain "ircs-u" (or other) as the desired port

If the correct port/service is missing then the auth-source query will
fail for a seemingly unknown reason.

This also allows a user to `(setopt erc-port "1234")', intentionally or
accidentally, and still be able to use .authinfo for password
management.
---
 lisp/erc/erc.el | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/lisp/erc/erc.el b/lisp/erc/erc.el
index 7028d0a68cc..81818a7227e 100644
--- a/lisp/erc/erc.el
+++ b/lisp/erc/erc.el
@@ -4675,8 +4675,7 @@ erc--auth-source-determine-params-defaults
                   (list net erc-server-announced-name erc-session-server)))
          (ports (list (cl-typecase erc-session-port
                         (integer (number-to-string erc-session-port))
-                        (string (and (string= erc-session-port "irc")
-                                     erc-session-port)) ; or nil
+                        (string erc-session-port) ; or nil
                         (t erc-session-port))
                       "irc")))
     (list (cons :host (delq nil hosts))
-- 
2.47.0


reply via email to

[Prev in Thread] Current Thread [Next in Thread]