From unknown Wed Jun 18 21:13:19 2025 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-Mailer: MIME-tools 5.509 (Entity 5.509) Content-Type: text/plain; charset=utf-8 From: bug#63973 <63973@debbugs.gnu.org> To: bug#63973 <63973@debbugs.gnu.org> Subject: Status: 30.0.50; ERC 5.6: Redo nick-regaining hook as a local module Reply-To: bug#63973 <63973@debbugs.gnu.org> Date: Thu, 19 Jun 2025 04:13:19 +0000 retitle 63973 30.0.50; ERC 5.6: Redo nick-regaining hook as a local module reassign 63973 emacs submitter 63973 "J.P." severity 63973 normal tag 63973 patch thanks From debbugs-submit-bounces@debbugs.gnu.org Fri Jun 09 09:58:00 2023 Received: (at submit) by debbugs.gnu.org; 9 Jun 2023 13:58:00 +0000 Received: from localhost ([127.0.0.1]:59959 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1q7ccn-0002qs-Hg for submit@debbugs.gnu.org; Fri, 09 Jun 2023 09:58:00 -0400 Received: from lists.gnu.org ([209.51.188.17]:46002) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1q7cci-0002qi-VT for submit@debbugs.gnu.org; Fri, 09 Jun 2023 09:57:55 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1q7cci-0007DC-8w for bug-gnu-emacs@gnu.org; Fri, 09 Jun 2023 09:57:52 -0400 Received: from mail-108-mta66.mxroute.com ([136.175.108.66]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1q7ccc-0006HK-GQ for bug-gnu-emacs@gnu.org; Fri, 09 Jun 2023 09:57:51 -0400 Received: from mail-111-mta2.mxroute.com ([136.175.111.2] filter006.mxroute.com) (Authenticated sender: mN4UYu2MZsgR) by mail-108-mta66.mxroute.com (ZoneMTA) with ESMTPSA id 188a072d91b00074ee.001 for (version=TLSv1/SSLv3 cipher=ECDHE-RSA-AES128-GCM-SHA256); Fri, 09 Jun 2023 13:57:41 +0000 X-Zone-Loop: 61e854cfa57fef4d2a3818d8d52e23d0788adefbecd3 X-Originating-IP: [136.175.111.2] 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:Date:Subject:To:From:Sender: Reply-To:Cc:Content-Transfer-Encoding:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: In-Reply-To:References:List-Id:List-Help:List-Unsubscribe:List-Subscribe: List-Post:List-Owner:List-Archive; bh=JkRJnnW4OyVnFnBpEAn18DCbaxiCR/Lz6pwGiqeUtyU=; b=XtYY7Q6XYrgiT1o+g4/jwnO2xg +6BxdsQjVaCZwzpZKI4LEm8nV2fNXdOcRuiFOYw3RhdT4H9vvbn6z9n79JGWfzlSIHp3Oeq9mASTG VQuy93GH9IhPlkgdADLc6YTZa4wlwTN4K24R6CDEo5WDeqfgTHxIK0RbgOeo/LeFPnSNNd7eyekzY gsCDP33egedOR3/Ft4HqGAo8PQw12jBOHflqd/7rzTIRH2IGi9bCQMrkZMbLZI2xKpL4Xr0k90KvI +v6StsrQys4omZmogzUR+eBE+6f4PpZfkaarAtC/nTt67ONFxRSvsKUUCY0k/4tRa6wVA6ZKjTwXt CLvSn84Q==; From: "J.P." To: bug-gnu-emacs@gnu.org Subject: 30.0.50; ERC 5.6: Redo nick-regaining hook as a local module X-Debbugs-CC: emacs-erc@gnu.org Date: Fri, 09 Jun 2023 06:57:38 -0700 Message-ID: <87v8fwwxf1.fsf@neverwas.me> User-Agent: Gnus/5.13 (Gnus v5.13) MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" X-Authenticated-Id: masked@neverwas.me Received-SPF: pass client-ip=136.175.108.66; envelope-from=jp@neverwas.me; helo=mail-108-mta66.mxroute.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-Spam-Score: -1.4 (-) X-Debbugs-Envelope-To: submit X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -2.4 (--) --=-=-= Content-Type: text/plain Tags: patch My previous attempt at introducing a bit of nick-regaining functionality came as a hook called `erc-nickname-in-use-functions' that only targeted a narrow use case involving stale nicks and automatic reconnections; it was admittedly inadequate. I've since redone it as a new (somewhat experimental) local module to live in erc-services.el alongside the main `services' module, which it's likely incompatible with since it expects confirmation of authentication before MOTD's end. If anyone feels strongly that it should play nicer with traditional `services' (in a way that preserves existing behavior, of course), please explain why and (preferably) how. Thanks. P.S. In the meantime, I'm going to go ahead and revert the hook-based version, which has been on HEAD for over a month now, so folks don't get too used to it. In GNU Emacs 30.0.50 (build 1, x86_64-pc-linux-gnu, GTK+ Version 3.24.37, cairo version 1.17.6) of 2023-06-09 built on localhost Repository revision: 3c01060c02359e5b813979b7b950bf904c87dcfa Repository branch: master Windowing system distributor 'The X.Org Foundation', version 11.0.12014000 System Description: Fedora Linux 37 (Workstation Edition) Configured using: 'configure --enable-check-lisp-object-type --enable-checking=yes,glyphs 'CFLAGS=-O0 -g3' PKG_CONFIG_PATH=:/usr/lib64/pkgconfig:/usr/share/pkgconfig' Configured features: ACL CAIRO DBUS FREETYPE GIF GLIB GMP GNUTLS GPM GSETTINGS HARFBUZZ JPEG JSON LCMS2 LIBOTF LIBSELINUX LIBSYSTEMD LIBXML2 M17N_FLT MODULES NOTIFY INOTIFY PDUMPER PNG RSVG SECCOMP SOUND SQLITE3 THREADS TIFF TOOLKIT_SCROLL_BARS WEBP X11 XDBE XIM XINPUT2 XPM GTK3 ZLIB Important settings: value of $LANG: en_US.UTF-8 value of $XMODIFIERS: @im=ibus locale-coding-system: utf-8-unix Major mode: Lisp Interaction Minor modes in effect: tooltip-mode: t global-eldoc-mode: t eldoc-mode: t show-paren-mode: t electric-indent-mode: t mouse-wheel-mode: t tool-bar-mode: t menu-bar-mode: t file-name-shadow-mode: t global-font-lock-mode: t font-lock-mode: t blink-cursor-mode: t line-number-mode: t indent-tabs-mode: t transient-mark-mode: t auto-composition-mode: t auto-encryption-mode: t auto-compression-mode: t Load-path shadows: None found. Features: (shadow sort mail-extr emacsbug message mailcap yank-media puny dired dired-loaddefs rfc822 mml mml-sec epa derived epg rfc6068 epg-config gnus-util text-property-search time-date mm-decode mm-bodies mm-encode mail-parse rfc2231 mailabbrev gmm-utils mailheader sendmail rfc2047 rfc2045 ietf-drums mm-util mail-prsvr mail-utils erc auth-source cl-seq eieio eieio-core cl-macs password-cache json subr-x map format-spec cl-loaddefs cl-lib erc-backend erc-networks byte-opt gv bytecomp byte-compile erc-common erc-compat erc-loaddefs rmc iso-transl tooltip cconv eldoc paren electric uniquify ediff-hook vc-hooks lisp-float-type elisp-mode mwheel term/x-win x-win term/common-win x-dnd tool-bar dnd fontset image regexp-opt fringe tabulated-list replace newcomment text-mode lisp-mode prog-mode register page tab-bar menu-bar rfn-eshadow isearch easymenu timer select scroll-bar mouse jit-lock font-lock syntax font-core term/tty-colors frame minibuffer nadvice seq simple cl-generic indonesian philippine cham georgian utf-8-lang misc-lang vietnamese tibetan thai tai-viet lao korean japanese eucjp-ms cp51932 hebrew greek romanian slovak czech european ethiopic indian cyrillic chinese composite emoji-zwj charscript charprop case-table epa-hook jka-cmpr-hook help abbrev obarray oclosure cl-preloaded button loaddefs theme-loaddefs faces cus-face macroexp files window text-properties overlay sha1 md5 base64 format env code-pages mule custom widget keymap hashtable-print-readable backquote threads dbusbind inotify lcms2 dynamic-setting system-font-setting font-render-setting cairo move-toolbar gtk x-toolkit xinput2 x multi-tty make-network-process emacs) Memory information: ((conses 16 64288 8839) (symbols 48 8586 0) (strings 32 23273 1806) (string-bytes 1 674739) (vectors 16 15021) (vector-slots 8 207340 7063) (floats 8 24 39) (intervals 56 231 0) (buffers 976 10)) --=-=-= Content-Type: text/x-patch Content-Disposition: attachment; filename=0001-Revert-Add-hook-to-regain-nickname-in-ERC.patch >From 5992bea9c50d00f4c462036044976e105b824fa8 Mon Sep 17 00:00:00 2001 From: "F. Jason Park" Date: Thu, 8 Jun 2023 23:38:05 -0700 Subject: [PATCH 1/2] Revert "Add hook to regain nickname in ERC" This reverts commit 8c0c98268440b27a77faf30738dfd72c909bb33f. The functionality it introduced is likely being migrated to a "regain"-specific local module to live in the library erc-services.el alongside the existing `services' module. Its scope will be expanded to address common "regain" cases requiring NickServ. This commit is being reverted to prevent any confusion that might arise from users encountering the old interface while the new one is being hashed out on the tracker. --- lisp/erc/erc-backend.el | 4 +- lisp/erc/erc.el | 47 ---------------- test/lisp/erc/erc-scenarios-base-renick.el | 43 -------------- .../base/renick/regain/normal-again.eld | 56 ------------------- .../resources/base/renick/regain/normal.eld | 53 ------------------ 5 files changed, 1 insertion(+), 202 deletions(-) delete mode 100644 test/lisp/erc/resources/base/renick/regain/normal-again.eld delete mode 100644 test/lisp/erc/resources/base/renick/regain/normal.eld diff --git a/lisp/erc/erc-backend.el b/lisp/erc/erc-backend.el index 2de24e7cb25..b5bd96c189d 100644 --- a/lisp/erc/erc-backend.el +++ b/lisp/erc/erc-backend.el @@ -427,9 +427,7 @@ erc-server-reconnect-timeout If this value is too low, servers may reject your initial nick request upon reconnecting because they haven't yet noticed that your previous connection is dead. If this happens, try setting -this value to 120 or greater and/or exploring the option -`erc-nickname-in-use-functions', which may provide a more -proactive means of handling this situation on some servers." +this value to 120 or greater." :type 'number) (defcustom erc-server-reconnect-function 'erc-server-delayed-reconnect diff --git a/lisp/erc/erc.el b/lisp/erc/erc.el index 2c2df81fa6d..97771b24e3d 100644 --- a/lisp/erc/erc.el +++ b/lisp/erc/erc.el @@ -403,24 +403,6 @@ erc-nick-changed-functions :group 'erc-hooks :type 'hook) -(defcustom erc-nickname-in-use-functions nil - "Function to run before trying for a different nickname. -Called with two arguments: the desired but just rejected nickname -and the alternate nickname about to be requested. Use cases -include special handling during connection registration and -wrestling with nickname services. For example, value -`erc-regain-nick-on-connect' is aimed at dealing with reaping -lingering connections that may prevent you from being issued a -requested nick immediately when reconnecting. It's meant to be -used with an `erc-server-reconnect-function' value of -`erc-server-delayed-check-reconnect' alongside SASL -authentication." - :package-version '(ERC . "5.6") - :group 'erc-hooks - :type '(choice (function-item erc-regain-nick-on-connect) - function - (const nil))) - (defcustom erc-connect-pre-hook '(erc-initialize-log-marker) "Hook called just before `erc' calls `erc-connect'. Functions are passed a buffer as the first argument." @@ -4976,34 +4958,6 @@ erc-wash-quit-reason (match-string 1 reason)) reason)) -(defun erc-regain-nick-on-connect (want temp) - "Try at most once to grab nickname WANT after settling for TEMP. -Only do so during connection registration, likely prior to -authenticating with SASL. Assume the prior connection was lost -due to connectivity failure and that the server hasn't yet -noticed. Also assume that the server won't process any -authentication-related messages until it has accepted a mulligan -nick or at least sent a 433 and thus triggered -`erc-nickname-in-use-functions'. Expect authentication to have -succeeded by the time a logical IRC connection has been -established and that the contending connection may otherwise -still be alive and require manual intervention involving -NickServ." - (unless erc-server-connected - (letrec ((after-connect - (lambda (_ nick) - (remove-hook 'erc-after-connect after-connect t) - (when (equal temp nick) - (erc-cmd-NICK want)))) - (on-900 - (lambda (_ parsed) - (remove-hook 'erc-server-900-functions on-900 t) - (unless erc-server-connected - (when (equal (car (erc-response.command-args parsed)) temp) - (add-hook 'erc-after-connect after-connect nil t))) - nil))) - (add-hook 'erc-server-900-functions on-900 nil t)))) - (defun erc-nickname-in-use (nick reason) "If NICK is unavailable, tell the user the REASON. @@ -5037,7 +4991,6 @@ erc-nickname-in-use ;; established a connection yet (- 9 (length erc-nick-uniquifier)))) erc-nick-uniquifier))) - (run-hook-with-args 'erc-nickname-in-use-functions nick newnick) (erc-cmd-NICK newnick) (erc-display-error-notice nil diff --git a/test/lisp/erc/erc-scenarios-base-renick.el b/test/lisp/erc/erc-scenarios-base-renick.el index f8350676fb7..f1723200533 100644 --- a/test/lisp/erc/erc-scenarios-base-renick.el +++ b/test/lisp/erc/erc-scenarios-base-renick.el @@ -303,47 +303,4 @@ erc-scenarios-base-renick-queries-bouncer (should-not (search-forward "now known as frenemy" nil t)) (erc-d-t-search-for 25 "I have lost")))) -;; The server rejects your nick during registration, so ERC acquires a -;; placeholder and successfully renicks once the connection is up. -;; See also `erc-scenarios-base-renick-self-auto'. - -(ert-deftest erc-scenarios-base-renick-auto-regain () - :tags '(:expensive-test) - (erc-scenarios-common-with-cleanup - ((erc-server-flood-penalty 0.1) - (erc-scenarios-common-dialog "base/renick/regain") - (dumb-server (erc-d-run "localhost" t 'normal 'normal-again)) - (port (process-contact dumb-server :service)) - (erc-server-auto-reconnect t) - (erc-modules (cons 'sasl erc-modules)) - (erc-nickname-in-use-functions '(erc-regain-nick-on-connect)) - (expect (erc-d-t-make-expecter))) - - (ert-info ("Session succeeds but cut short") - (with-current-buffer (erc :server "127.0.0.1" - :port port - :nick "tester" - :user "tester" - :password "changeme" - :full-name "tester") - (funcall expect 10 "Last login from") - (erc-cmd-JOIN "#test"))) - - (with-current-buffer (erc-d-t-wait-for 10 (get-buffer "#test")) - (funcall expect 10 "was created on")) - - (ert-info ("Service restored") - (with-current-buffer "Libera.Chat" - (erc-d-t-wait-for 10 erc--server-reconnect-timer) - (funcall expect 10 "Connection failed!") - (funcall expect 10 "already in use") - (funcall expect 10 "changed mode for tester`") - (funcall expect 10 "Last login from") - (funcall expect 10 "Your new nickname is tester"))) - - (with-current-buffer (get-buffer "#test") - (funcall expect 10 "tester ") - (funcall expect 10 "was created on")))) - - ;;; erc-scenarios-base-renick.el ends here diff --git a/test/lisp/erc/resources/base/renick/regain/normal-again.eld b/test/lisp/erc/resources/base/renick/regain/normal-again.eld deleted file mode 100644 index c0529052c70..00000000000 --- a/test/lisp/erc/resources/base/renick/regain/normal-again.eld +++ /dev/null @@ -1,56 +0,0 @@ -;; -*- mode: lisp-data; -*- -((cap 10 "CAP REQ :sasl")) -((nick 10 "NICK tester")) -((user 10 "USER tester 0 * :tester")) - -((authenticate 10 "AUTHENTICATE PLAIN") - (0.04 ":tantalum.libera.chat NOTICE * :*** Checking Ident") - (0.01 ":tantalum.libera.chat NOTICE * :*** Looking up your hostname...") - (0.01 ":tantalum.libera.chat NOTICE * :*** Couldn't look up your hostname") - (0.06 ":tantalum.libera.chat NOTICE * :*** No Ident response") - (0.02 ":tantalum.libera.chat CAP * ACK :sasl") - (0.03 ":tantalum.libera.chat 433 * tester :Nickname is already in use.")) - -((nick 10 "NICK tester`") - (0.03 "AUTHENTICATE +")) - -((authenticate 10 "AUTHENTICATE AHRlc3RlcgBjaGFuZ2VtZQ==") - (0.06 ":tantalum.libera.chat 900 tester` tester`!tester@127.0.0.1 tester :You are now logged in as tester") - (0.02 ":tantalum.libera.chat 903 tester` :SASL authentication successful")) - -((cap 10 "CAP END") - (0.02 ":tantalum.libera.chat 001 tester` :Welcome to the Libera.Chat Internet Relay Chat Network tester`") - (0.02 ":tantalum.libera.chat 002 tester` :Your host is tantalum.libera.chat[93.158.237.2/6697], running version solanum-1.0-dev") - (0.02 ":tantalum.libera.chat 003 tester` :This server was created Mon Feb 13 2023 at 12:05:04 UTC") - (0.01 ":tantalum.libera.chat 004 tester` tantalum.libera.chat solanum-1.0-dev DGMQRSZaghilopsuwz CFILMPQRSTbcefgijklmnopqrstuvz bkloveqjfI") - (0.01 ":tantalum.libera.chat 005 tester` WHOX MONITOR=100 SAFELIST ELIST=CMNTU ETRACE FNC CALLERID=g KNOCK CHANTYPES=# EXCEPTS INVEX CHANMODES=eIbq,k,flj,CFLMPQRSTcgimnprstuz :are supported by this server") - (0.01 ":tantalum.libera.chat 005 tester` CHANLIMIT=#:250 PREFIX=(ov)@+ MAXLIST=bqeI:100 MODES=4 NETWORK=Libera.Chat STATUSMSG=@+ CASEMAPPING=rfc1459 NICKLEN=16 MAXNICKLEN=16 CHANNELLEN=50 TOPICLEN=390 DEAF=D :are supported by this server") - (0.03 ":tantalum.libera.chat 005 tester` TARGMAX=NAMES:1,LIST:1,KICK:1,WHOIS:1,PRIVMSG:4,NOTICE:4,ACCEPT:,MONITOR: EXTBAN=$,ajrxz :are supported by this server") - (0.01 ":tantalum.libera.chat 251 tester` :There are 70 users and 42977 invisible on 28 servers") - (0.00 ":tantalum.libera.chat 252 tester` 38 :IRC Operators online") - (0.00 ":tantalum.libera.chat 253 tester` 87 :unknown connection(s)") - (0.00 ":tantalum.libera.chat 254 tester` 22908 :channels formed") - (0.00 ":tantalum.libera.chat 255 tester` :I have 2507 clients and 1 servers") - (0.00 ":tantalum.libera.chat 265 tester` 2507 3232 :Current local users 2507, max 3232") - (0.00 ":tantalum.libera.chat 266 tester` 43047 51777 :Current global users 43047, max 51777") - (0.00 ":tantalum.libera.chat 250 tester` :Highest connection count: 3233 (3232 clients) (284887 connections received)") - (0.03 ":tantalum.libera.chat 375 tester` :- tantalum.libera.chat Message of the Day - ") - (0.00 ":tantalum.libera.chat 372 tester` :- This server provided by Hyperfilter (https://hyperfilter.com)") - (0.00 ":tantalum.libera.chat 372 tester` :- Email: support@libera.chat") - (0.02 ":tantalum.libera.chat 376 tester` :End of /MOTD command.")) - -((mode 10 "MODE tester` +i") - (0.01 ":tester` MODE tester` :+Ziw") - (0.02 ":SaslServ!SaslServ@services.libera.chat NOTICE tester` :Last login from: \2~tester@127.0.0.1\2 on Apr 07 01:36:25 2023 +0000.")) - -((nick 10 "NICK tester") - (0.02 ":tester`!~tester@127.0.0.1 NICK :tester")) - -((join 10 "JOIN #test") - (0.02 ":tester!~tester@127.0.0.1 JOIN #test") - (0.02 ":tantalum.libera.chat 353 tester = #test :tester zbyqbepbqre7 pusevgfpu Thrfg2187 zngbeb qnexNssvavgl wrebzr- rqpentt Ilehf grfg2 AvtugZbaxrl pevfgvvbna xrivap_ fnvybePng shohxv gxan arrqyr avpx16 NeanhqW_kzcc jvyyr wrnaogeq Wnarg cnefavc0 Xbentt RcvpArb flfqrs wfgbxre hafcrag__ Lbevpx_") - (0.02 ":tantalum.libera.chat 366 tester #test :End of /NAMES list.")) - -((mode 10 "MODE #test") - (0.02 ":tantalum.libera.chat 324 tester #test +nt") - (0.02 ":tantalum.libera.chat 329 tester #test 1621432263")) diff --git a/test/lisp/erc/resources/base/renick/regain/normal.eld b/test/lisp/erc/resources/base/renick/regain/normal.eld deleted file mode 100644 index 9f4df70e580..00000000000 --- a/test/lisp/erc/resources/base/renick/regain/normal.eld +++ /dev/null @@ -1,53 +0,0 @@ -;; -*- mode: lisp-data; -*- -((cap 10 "CAP REQ :sasl")) -((nick 10 "NICK tester")) -((user 10 "USER tester 0 * :tester")) - -((authenticate 10 "AUTHENTICATE PLAIN") - (0.02 ":cadmium.libera.chat NOTICE * :*** Checking Ident") - (0.01 ":cadmium.libera.chat NOTICE * :*** Looking up your hostname...") - (0.01 ":cadmium.libera.chat NOTICE * :*** Couldn't look up your hostname") - (0.06 ":cadmium.libera.chat NOTICE * :*** No Ident response") - (0.09 ":cadmium.libera.chat CAP * ACK :sasl") - (0.01 "AUTHENTICATE +")) - -((authenticate 10 "AUTHENTICATE AHRlc3RlcgBjaGFuZ2VtZQ==") - (0.03 ":cadmium.libera.chat 900 tester tester!tester@127.0.0.1 tester :You are now logged in as tester") - (0.01 ":cadmium.libera.chat 903 tester :SASL authentication successful")) - -((cap 10 "CAP END") - (0.03 ":cadmium.libera.chat 001 tester :Welcome to the Libera.Chat Internet Relay Chat Network tester") - (0.02 ":cadmium.libera.chat 002 tester :Your host is cadmium.libera.chat[103.196.37.95/6697], running version solanum-1.0-dev") - (0.01 ":cadmium.libera.chat 003 tester :This server was created Wed Jan 25 2023 at 10:22:45 UTC") - (0.01 ":cadmium.libera.chat 004 tester cadmium.libera.chat solanum-1.0-dev DGMQRSZaghilopsuwz CFILMPQRSTbcefgijklmnopqrstuvz bkloveqjfI") - (0.00 ":cadmium.libera.chat 005 tester CALLERID=g WHOX ETRACE FNC SAFELIST ELIST=CMNTU KNOCK MONITOR=100 CHANTYPES=# EXCEPTS INVEX CHANMODES=eIbq,k,flj,CFLMPQRSTcgimnprstuz :are supported by this server") - (0.01 ":cadmium.libera.chat 005 tester CHANLIMIT=#:250 PREFIX=(ov)@+ MAXLIST=bqeI:100 MODES=4 NETWORK=Libera.Chat STATUSMSG=@+ CASEMAPPING=rfc1459 NICKLEN=16 MAXNICKLEN=16 CHANNELLEN=50 TOPICLEN=390 DEAF=D :are supported by this server") - (0.01 ":cadmium.libera.chat 005 tester TARGMAX=NAMES:1,LIST:1,KICK:1,WHOIS:1,PRIVMSG:4,NOTICE:4,ACCEPT:,MONITOR: EXTBAN=$,ajrxz :are supported by this server") - (0.01 ":cadmium.libera.chat 251 tester :There are 70 users and 42996 invisible on 28 servers") - (0.02 ":cadmium.libera.chat 252 tester 38 :IRC Operators online") - (0.01 ":cadmium.libera.chat 253 tester 57 :unknown connection(s)") - (0.01 ":cadmium.libera.chat 254 tester 22912 :channels formed") - (0.01 ":cadmium.libera.chat 255 tester :I have 2499 clients and 1 servers") - (0.01 ":cadmium.libera.chat 265 tester 2499 4187 :Current local users 2499, max 4187") - (0.01 ":cadmium.libera.chat 266 tester 43066 51827 :Current global users 43066, max 51827") - (0.01 ":cadmium.libera.chat 250 tester :Highest connection count: 4188 (4187 clients) (319420 connections received)") - (0.01 ":cadmium.libera.chat 375 tester :- cadmium.libera.chat Message of the Day - ") - (0.01 ":cadmium.libera.chat 372 tester :- This server kindly provided by Mach Dilemma (www.m-d.net)") - (0.01 ":cadmium.libera.chat 372 tester :- Welcome to Libera Chat, the IRC network for") - (0.00 ":cadmium.libera.chat 372 tester :- Email: support@libera.chat") - (0.00 ":cadmium.libera.chat 376 tester :End of /MOTD command.") - (0.00 ":tester MODE tester :+Ziw") - (0.02 ":SaslServ!SaslServ@services.libera.chat NOTICE tester :Last login from: \2~tester@127.0.0.1\2 on Apr 07 01:02:11 2023 +0000.")) - -((mode 10 "MODE tester +i")) - -((join 10 "JOIN #test") - (0.09 ":tester!~tester@127.0.0.1 JOIN #test")) - -((mode 10 "MODE #test") - (0.03 ":cadmium.libera.chat 353 tester = #test :tester zbyqbepbqre7 pusevgfpu Thrfg2187 zngbeb qnexNssvavgl wrebzr- rqpentt Ilehf grfg2 AvtugZbaxrl pevfgvvbna xrivap_ fnvybePng shohxv gxan arrqyr avpx16 NeanhqW_kzcc Lbevpx_ hafcrag__ wfgbxre flfqrs RcvpArb Xbentt jvyyr cnefavc0 Wnarg wrnaogeq") - (0.02 ":cadmium.libera.chat 366 tester #test :End of /NAMES list.") - (0.00 ":cadmium.libera.chat 324 tester #test +nt") - (0.01 ":cadmium.libera.chat 329 tester #test 1621432263")) - -((drop 0 DROP)) -- 2.40.1 --=-=-= Content-Type: text/x-patch Content-Disposition: attachment; filename=0002-5.6-Redo-erc-nickname-in-use-functions-as-a-local-mo.patch >From d4f6e95fa3bb7f10b2d19d3dfbe1c68f96145712 Mon Sep 17 00:00:00 2001 From: "F. Jason Park" Date: Thu, 8 Jun 2023 23:49:23 -0700 Subject: [PATCH 2/2] [5.6] Redo erc-nickname-in-use-functions as a local module * etc/ERC-NEWS: Mention new module `services-regain'. * lisp/erc/erc-backend.el: Rename option. * lisp/erc/erc-services.el (erc-services-regain-alist): Strategies for regaining a lost nickname on reconnect. This option, in addition to the rest of these changes, are a redo of `erc-nickname-in-use-functions' from commit 8c0c9826 "Add hook to regain nickname in ERC", which originally stemmed from bug#62044. (erc-services-retry-nick-on-connect, erc-services-issue-regain, erc-services-issue-ghost-and-retry-nick): New helper and function variants for `erc-services-regain-alist. (erc-services-regain-mode, erc-services-regain-enable, erc-services-regain-disable): New local module to activate nick-regaining behavior. (erc--nickname-in-use-make-request): New function, a services-specific implementation. * lisp/erc/erc.el (erc--nickname-in-use-make-request): New generic function to request alternate nick when first choice is rejected. (erc-nickname-in-use): Call function `erc--nickname-in-use-make-request' to request alternate nick. * test/lisp/erc/erc-scenarios-base-renick.el (erc-scenarios-base-renick-auto-regain): Move to services file. * test/lisp/erc/erc-scenarios-services-misc.el (erc-scenarios-services-misc--reconnect-retry-nick): Adopt renamed version of `erc-scenarios-base-renick-auto-regain'. (erc-scenarios-services-misc--regain-command, erc-scenarios-services-misc--ghost-and-retry-nick): New tests. * test/lisp/erc/resources/services/regain/reconnect-retry-again.eld: New file reusing existing blob c0529052 that once lived at resources/base/renick/regain/normal-again.eld. * test/lisp/erc/resources/services/regain/reconnect-retry.eld: New file reusing existing blob 9f4df70e5 that once lived at resources/base/renick/regain/normal.eld. --- etc/ERC-NEWS | 6 +- lisp/erc/erc-backend.el | 4 +- lisp/erc/erc-services.el | 121 ++++++++++++++++++ lisp/erc/erc.el | 6 +- test/lisp/erc/erc-scenarios-services-misc.el | 105 +++++++++++++++ .../services/regain/reconnect-retry-again.eld | 56 ++++++++ .../services/regain/reconnect-retry.eld | 53 ++++++++ .../resources/services/regain/taken-ghost.eld | 42 ++++++ .../services/regain/taken-regain.eld | 42 ++++++ 9 files changed, 430 insertions(+), 5 deletions(-) create mode 100644 test/lisp/erc/resources/services/regain/reconnect-retry-again.eld create mode 100644 test/lisp/erc/resources/services/regain/reconnect-retry.eld create mode 100644 test/lisp/erc/resources/services/regain/taken-ghost.eld create mode 100644 test/lisp/erc/resources/services/regain/taken-regain.eld diff --git a/etc/ERC-NEWS b/etc/ERC-NEWS index e9ec9e2caab..56d3b935321 100644 --- a/etc/ERC-NEWS +++ b/etc/ERC-NEWS @@ -78,9 +78,9 @@ appearing in their saved logs. ** Smarter reconnect handling for users on the move. ERC now offers a new, experimental reconnect strategy in the function 'erc-server-delayed-check-reconnect', which tests for underlying -connectivity before attempting to reconnect in earnest. See options -'erc-server-reconnect-function' and 'erc-nickname-in-use-functions' to -get started. +connectivity before attempting to reconnect in earnest. See option +'erc-server-reconnect-function' and new local module 'services-regain' +(also experimental) to get started. ** Easily constrain all ERC-related business to a dedicated frame. The option 'erc-reuse-frames' can now be set to 'displayed', which diff --git a/lisp/erc/erc-backend.el b/lisp/erc/erc-backend.el index b5bd96c189d..f1b51f9234a 100644 --- a/lisp/erc/erc-backend.el +++ b/lisp/erc/erc-backend.el @@ -427,7 +427,9 @@ erc-server-reconnect-timeout If this value is too low, servers may reject your initial nick request upon reconnecting because they haven't yet noticed that your previous connection is dead. If this happens, try setting -this value to 120 or greater." +this value to 120 or greater and/or exploring the option +`erc-regain-services-alist', which may provide a more proactive +means of handling this situation on some servers." :type 'number) (defcustom erc-server-reconnect-function 'erc-server-delayed-reconnect diff --git a/lisp/erc/erc-services.el b/lisp/erc/erc-services.el index 5408ba405db..227492c4e2c 100644 --- a/lisp/erc/erc-services.el +++ b/lisp/erc/erc-services.el @@ -513,6 +513,127 @@ erc-nickserv-identify nick) nil)) + +;;;; Regaining nicknames + +(defcustom erc-services-regain-alist nil + "Alist mapping networks to nickname-regaining functions. +This option depends on the `services-regain' module being loaded. +Keys can also be symbols for user-provided \"context IDs\" (see +info node `Network Identifier'). Functions run once, when first +establishing a logical IRC connection. Although ERC currently +calls them with one argument, the desired but rejected nickname, +robust user implementations should leave room for later additions +by defining an &rest _ parameter, as well. + +The simplest value is `erc-services-retry-nick-on-connect', which +attempts to kill off stale connections without engaging services +at all. Others, like `erc-services-issue-regain', and +`erc-services-issue-ghost-and-retry-nick', only speak a +particular flavor of NickServ. See their respective doc strings +for details and use cases." + :package-version '(ERC . "5.6") + :group 'erc-hooks + :type '(alist :key-type (symbol :tag "Network") + :value-type + (choice :tag "Strategy function" + (function-item erc-services-retry-nick-on-connect) + (funcion-item erc-services-issue-regain) + (function-item erc-services-issue-ghost-and-retry-nick) + function))) + +(defun erc-services-retry-nick-on-connect (want) + "Try at most once to grab nickname WANT after reconnecting. +Expect to be used when automatically reconnecting to servers +that are slow to abandon the previous connection. + +Note that this strategy may only work under certain conditions, +such as when a user's account name matches their nick." + (erc-cmd-NICK want)) + +(defun erc-services-issue-regain (want) + "Ask NickServ to regain nickname WANT. +Assume WANT belongs to the user and that the services suite +offers a \"REGAIN\" sub-command." + (erc-cmd-MSG (concat "NickServ REGAIN " want))) + +(defun erc-services-issue-ghost-and-retry-nick (want) + "Ask NickServ to \"GHOST\" nickname WANT. +After which, attempt to grab WANT before the contending party +reconnects. Assume the ERC user owns WANT and that the server's +services suite lacks a \"REGAIN\" command. + +Note that this function will only work for a specific services +implementation and is meant primarily as an example for adapting +as needed." + ;; While heuristics based on error text may seem brittle, consider + ;; the fact that \"is not online\" has been present in Atheme's + ;; \"GHOST\" responses since at least 2005. + (letrec ((attempts 3) + (on-notice + (lambda (_proc parsed) + (when-let ((nick (erc-extract-nick + (erc-response.sender parsed))) + ((erc-nick-equal-p nick "nickserv")) + (contents (erc-response.contents parsed)) + (case-fold-search t) + ((string-match (rx (or "ghost" "is not online")) + contents))) + (setq attempts 1) + (erc-server-send (concat "NICK " want) 'force)) + (when (zerop (cl-decf attempts)) + (remove-hook 'erc-server-NOTICE-functions on-notice t)) + nil))) + (add-hook 'erc-server-NOTICE-functions on-notice nil t) + (erc-message "PRIVMSG" (concat "NickServ GHOST " want)))) + +;;;###autoload(put 'services-regain 'erc--feature 'erc-services) +(define-erc-module services-regain nil + "Reacquire a nickname from your past self or some interloper. +This module only concerns itself with initial nick rejections +that occur during connection registration in response to an +opening \"NICK\" command. More specifically, the following +conditions must be met for ERC to activate this mechanism and +consider its main option, `erc-services-regain-alist': + + - the server must reject the opening \"NICK\" request + - ERC must request a temporary nickname + - the user must successfully authenticate + +In practical terms, this means that this module, which is still +somewhat experimental, is likely only useful in conjunction with +SASL authentication rather than the traditional approach provided +by the `services' module it shares a library with (see info +node `(erc) SASL' for more)." + nil nil 'local) + +(cl-defmethod erc--nickname-in-use-make-request + ((want string) temp &context (erc-server-connected null) + (erc-services-regain-mode (eql t)) + (erc-services-regain-alist cons)) + "Schedule possible regain attempt upon establishing connection. +Expect WANT to be the desired nickname and TEMP to be the current +one." + (letrec + ((after-connect + (lambda (_ nick) + (remove-hook 'erc-after-connect after-connect t) + (when-let* + (((equal temp nick)) + (conn (or (erc-networks--id-given erc-networks--id) + (erc-network))) + (found (alist-get conn erc-services-regain-alist))) + (funcall found want)))) + (on-900 + (lambda (_ parsed) + (remove-hook 'erc-server-900-functions on-900 t) + (unless erc-server-connected + (when (equal (car (erc-response.command-args parsed)) temp) + (add-hook 'erc-after-connect after-connect nil t))) + nil))) + (add-hook 'erc-server-900-functions on-900 nil t)) + (cl-call-next-method)) + (provide 'erc-services) diff --git a/lisp/erc/erc.el b/lisp/erc/erc.el index 97771b24e3d..ba9d4f9ae02 100644 --- a/lisp/erc/erc.el +++ b/lisp/erc/erc.el @@ -4958,6 +4958,10 @@ erc-wash-quit-reason (match-string 1 reason)) reason)) +(cl-defmethod erc--nickname-in-use-make-request (_nick temp) + "Request nickname TEMP in place of rejected NICK." + (erc-cmd-NICK temp)) + (defun erc-nickname-in-use (nick reason) "If NICK is unavailable, tell the user the REASON. @@ -4991,7 +4995,7 @@ erc-nickname-in-use ;; established a connection yet (- 9 (length erc-nick-uniquifier)))) erc-nick-uniquifier))) - (erc-cmd-NICK newnick) + (erc--nickname-in-use-make-request nick newnick) (erc-display-error-notice nil (format "Nickname %s is %s, trying %s" diff --git a/test/lisp/erc/erc-scenarios-services-misc.el b/test/lisp/erc/erc-scenarios-services-misc.el index a1679d302f4..1113849578f 100644 --- a/test/lisp/erc/erc-scenarios-services-misc.el +++ b/test/lisp/erc/erc-scenarios-services-misc.el @@ -143,4 +143,109 @@ erc-scenarios-services-auth-source-reconnect (erc-services-mode -1))) +;; The server rejects your nick during registration, so ERC acquires a +;; placeholder and successfully renicks once the connection is up. +;; See also `erc-scenarios-base-renick-self-auto'. + +(ert-deftest erc-scenarios-services-misc--reconnect-retry-nick () + :tags '(:expensive-test) + (erc-scenarios-common-with-cleanup + ((erc-server-flood-penalty 0.1) + (erc-scenarios-common-dialog "services/regain") + (dumb-server (erc-d-run "localhost" t 'reconnect-retry + 'reconnect-retry-again)) + (port (process-contact dumb-server :service)) + (erc-server-auto-reconnect t) + (erc-modules `(services-regain sasl ,@erc-modules)) + (erc-services-regain-alist + '((Libera.Chat . erc-services-retry-nick-on-connect))) + (expect (erc-d-t-make-expecter))) + + ;; FIXME figure out and explain why this is so. + (should (featurep 'erc-services)) + + (ert-info ("Session succeeds but cut short") + (with-current-buffer (erc :server "127.0.0.1" + :port port + :nick "tester" + :user "tester" + :password "changeme" + :full-name "tester") + (funcall expect 10 "Last login from") + (erc-cmd-JOIN "#test"))) + + (with-current-buffer (erc-d-t-wait-for 10 (get-buffer "#test")) + (funcall expect 10 "was created on")) + + (ert-info ("Service restored") + (with-current-buffer "Libera.Chat" + (erc-d-t-wait-for 10 erc--server-reconnect-timer) + (funcall expect 10 "Connection failed!") + (funcall expect 10 "already in use") + (funcall expect 10 "changed mode for tester`") + (funcall expect 10 "Last login from") + (funcall expect 10 "Your new nickname is tester"))) + + (with-current-buffer (get-buffer "#test") + (funcall expect 10 "tester ") + (funcall expect 10 "was created on")))) + +;; This only asserts that the handler fires and issues the right +;; NickServ command, but it doesn't accurately recreate a +;; disconnection, but it probably should. +(ert-deftest erc-scenarios-services-misc--regain-command () + :tags '(:expensive-test) + (erc-scenarios-common-with-cleanup + ((erc-server-flood-penalty 0.1) + (erc-scenarios-common-dialog "services/regain") + (dumb-server (erc-d-run "localhost" t 'taken-regain)) + (port (process-contact dumb-server :service)) + (erc-server-auto-reconnect t) + (erc-modules `(services-regain sasl ,@erc-modules)) + (erc-services-regain-alist + '((ExampleNet . erc-services-issue-regain))) + (expect (erc-d-t-make-expecter))) + + (should (featurep 'erc-services)) ; see note in prior test + + (with-current-buffer (erc :server "127.0.0.1" + :port port + :nick "dummy" + :user "tester" + :password "changeme" + :full-name "tester" + :id 'ExampleNet) + (funcall expect 10 "dummy is already in use, trying dummy`") + (funcall expect 10 "You are now logged in as tester") + (funcall expect 10 "-NickServ- dummy has been regained.") + (funcall expect 10 "*** Your new nickname is dummy") + ;; Works with "given" `:id'. + (should (and (erc-network) (not (eq (erc-network) 'ExampleNet))))))) + +(ert-deftest erc-scenarios-services-misc--ghost-and-retry-nick () + :tags '(:expensive-test) + (erc-scenarios-common-with-cleanup + ((erc-server-flood-penalty 0.1) + (erc-scenarios-common-dialog "services/regain") + (dumb-server (erc-d-run "localhost" t 'taken-ghost)) + (port (process-contact dumb-server :service)) + (erc-server-auto-reconnect t) + (erc-modules `(services-regain sasl ,@erc-modules)) + (erc-services-regain-alist + '((FooNet . erc-services-issue-ghost-and-retry-nick))) + (expect (erc-d-t-make-expecter))) + + (should (featurep 'erc-services)) ; see note in prior test + + (with-current-buffer (erc :server "127.0.0.1" + :port port + :nick "dummy" + :user "tester" + :password "changeme" + :full-name "tester") + (funcall expect 10 "dummy is already in use, trying dummy`") + (funcall expect 10 "You are now logged in as tester") + (funcall expect 10 "-NickServ- dummy has been ghosted.") + (funcall expect 10 "*** Your new nickname is dummy")))) + ;;; erc-scenarios-services-misc.el ends here diff --git a/test/lisp/erc/resources/services/regain/reconnect-retry-again.eld b/test/lisp/erc/resources/services/regain/reconnect-retry-again.eld new file mode 100644 index 00000000000..c0529052c70 --- /dev/null +++ b/test/lisp/erc/resources/services/regain/reconnect-retry-again.eld @@ -0,0 +1,56 @@ +;; -*- mode: lisp-data; -*- +((cap 10 "CAP REQ :sasl")) +((nick 10 "NICK tester")) +((user 10 "USER tester 0 * :tester")) + +((authenticate 10 "AUTHENTICATE PLAIN") + (0.04 ":tantalum.libera.chat NOTICE * :*** Checking Ident") + (0.01 ":tantalum.libera.chat NOTICE * :*** Looking up your hostname...") + (0.01 ":tantalum.libera.chat NOTICE * :*** Couldn't look up your hostname") + (0.06 ":tantalum.libera.chat NOTICE * :*** No Ident response") + (0.02 ":tantalum.libera.chat CAP * ACK :sasl") + (0.03 ":tantalum.libera.chat 433 * tester :Nickname is already in use.")) + +((nick 10 "NICK tester`") + (0.03 "AUTHENTICATE +")) + +((authenticate 10 "AUTHENTICATE AHRlc3RlcgBjaGFuZ2VtZQ==") + (0.06 ":tantalum.libera.chat 900 tester` tester`!tester@127.0.0.1 tester :You are now logged in as tester") + (0.02 ":tantalum.libera.chat 903 tester` :SASL authentication successful")) + +((cap 10 "CAP END") + (0.02 ":tantalum.libera.chat 001 tester` :Welcome to the Libera.Chat Internet Relay Chat Network tester`") + (0.02 ":tantalum.libera.chat 002 tester` :Your host is tantalum.libera.chat[93.158.237.2/6697], running version solanum-1.0-dev") + (0.02 ":tantalum.libera.chat 003 tester` :This server was created Mon Feb 13 2023 at 12:05:04 UTC") + (0.01 ":tantalum.libera.chat 004 tester` tantalum.libera.chat solanum-1.0-dev DGMQRSZaghilopsuwz CFILMPQRSTbcefgijklmnopqrstuvz bkloveqjfI") + (0.01 ":tantalum.libera.chat 005 tester` WHOX MONITOR=100 SAFELIST ELIST=CMNTU ETRACE FNC CALLERID=g KNOCK CHANTYPES=# EXCEPTS INVEX CHANMODES=eIbq,k,flj,CFLMPQRSTcgimnprstuz :are supported by this server") + (0.01 ":tantalum.libera.chat 005 tester` CHANLIMIT=#:250 PREFIX=(ov)@+ MAXLIST=bqeI:100 MODES=4 NETWORK=Libera.Chat STATUSMSG=@+ CASEMAPPING=rfc1459 NICKLEN=16 MAXNICKLEN=16 CHANNELLEN=50 TOPICLEN=390 DEAF=D :are supported by this server") + (0.03 ":tantalum.libera.chat 005 tester` TARGMAX=NAMES:1,LIST:1,KICK:1,WHOIS:1,PRIVMSG:4,NOTICE:4,ACCEPT:,MONITOR: EXTBAN=$,ajrxz :are supported by this server") + (0.01 ":tantalum.libera.chat 251 tester` :There are 70 users and 42977 invisible on 28 servers") + (0.00 ":tantalum.libera.chat 252 tester` 38 :IRC Operators online") + (0.00 ":tantalum.libera.chat 253 tester` 87 :unknown connection(s)") + (0.00 ":tantalum.libera.chat 254 tester` 22908 :channels formed") + (0.00 ":tantalum.libera.chat 255 tester` :I have 2507 clients and 1 servers") + (0.00 ":tantalum.libera.chat 265 tester` 2507 3232 :Current local users 2507, max 3232") + (0.00 ":tantalum.libera.chat 266 tester` 43047 51777 :Current global users 43047, max 51777") + (0.00 ":tantalum.libera.chat 250 tester` :Highest connection count: 3233 (3232 clients) (284887 connections received)") + (0.03 ":tantalum.libera.chat 375 tester` :- tantalum.libera.chat Message of the Day - ") + (0.00 ":tantalum.libera.chat 372 tester` :- This server provided by Hyperfilter (https://hyperfilter.com)") + (0.00 ":tantalum.libera.chat 372 tester` :- Email: support@libera.chat") + (0.02 ":tantalum.libera.chat 376 tester` :End of /MOTD command.")) + +((mode 10 "MODE tester` +i") + (0.01 ":tester` MODE tester` :+Ziw") + (0.02 ":SaslServ!SaslServ@services.libera.chat NOTICE tester` :Last login from: \2~tester@127.0.0.1\2 on Apr 07 01:36:25 2023 +0000.")) + +((nick 10 "NICK tester") + (0.02 ":tester`!~tester@127.0.0.1 NICK :tester")) + +((join 10 "JOIN #test") + (0.02 ":tester!~tester@127.0.0.1 JOIN #test") + (0.02 ":tantalum.libera.chat 353 tester = #test :tester zbyqbepbqre7 pusevgfpu Thrfg2187 zngbeb qnexNssvavgl wrebzr- rqpentt Ilehf grfg2 AvtugZbaxrl pevfgvvbna xrivap_ fnvybePng shohxv gxan arrqyr avpx16 NeanhqW_kzcc jvyyr wrnaogeq Wnarg cnefavc0 Xbentt RcvpArb flfqrs wfgbxre hafcrag__ Lbevpx_") + (0.02 ":tantalum.libera.chat 366 tester #test :End of /NAMES list.")) + +((mode 10 "MODE #test") + (0.02 ":tantalum.libera.chat 324 tester #test +nt") + (0.02 ":tantalum.libera.chat 329 tester #test 1621432263")) diff --git a/test/lisp/erc/resources/services/regain/reconnect-retry.eld b/test/lisp/erc/resources/services/regain/reconnect-retry.eld new file mode 100644 index 00000000000..9f4df70e580 --- /dev/null +++ b/test/lisp/erc/resources/services/regain/reconnect-retry.eld @@ -0,0 +1,53 @@ +;; -*- mode: lisp-data; -*- +((cap 10 "CAP REQ :sasl")) +((nick 10 "NICK tester")) +((user 10 "USER tester 0 * :tester")) + +((authenticate 10 "AUTHENTICATE PLAIN") + (0.02 ":cadmium.libera.chat NOTICE * :*** Checking Ident") + (0.01 ":cadmium.libera.chat NOTICE * :*** Looking up your hostname...") + (0.01 ":cadmium.libera.chat NOTICE * :*** Couldn't look up your hostname") + (0.06 ":cadmium.libera.chat NOTICE * :*** No Ident response") + (0.09 ":cadmium.libera.chat CAP * ACK :sasl") + (0.01 "AUTHENTICATE +")) + +((authenticate 10 "AUTHENTICATE AHRlc3RlcgBjaGFuZ2VtZQ==") + (0.03 ":cadmium.libera.chat 900 tester tester!tester@127.0.0.1 tester :You are now logged in as tester") + (0.01 ":cadmium.libera.chat 903 tester :SASL authentication successful")) + +((cap 10 "CAP END") + (0.03 ":cadmium.libera.chat 001 tester :Welcome to the Libera.Chat Internet Relay Chat Network tester") + (0.02 ":cadmium.libera.chat 002 tester :Your host is cadmium.libera.chat[103.196.37.95/6697], running version solanum-1.0-dev") + (0.01 ":cadmium.libera.chat 003 tester :This server was created Wed Jan 25 2023 at 10:22:45 UTC") + (0.01 ":cadmium.libera.chat 004 tester cadmium.libera.chat solanum-1.0-dev DGMQRSZaghilopsuwz CFILMPQRSTbcefgijklmnopqrstuvz bkloveqjfI") + (0.00 ":cadmium.libera.chat 005 tester CALLERID=g WHOX ETRACE FNC SAFELIST ELIST=CMNTU KNOCK MONITOR=100 CHANTYPES=# EXCEPTS INVEX CHANMODES=eIbq,k,flj,CFLMPQRSTcgimnprstuz :are supported by this server") + (0.01 ":cadmium.libera.chat 005 tester CHANLIMIT=#:250 PREFIX=(ov)@+ MAXLIST=bqeI:100 MODES=4 NETWORK=Libera.Chat STATUSMSG=@+ CASEMAPPING=rfc1459 NICKLEN=16 MAXNICKLEN=16 CHANNELLEN=50 TOPICLEN=390 DEAF=D :are supported by this server") + (0.01 ":cadmium.libera.chat 005 tester TARGMAX=NAMES:1,LIST:1,KICK:1,WHOIS:1,PRIVMSG:4,NOTICE:4,ACCEPT:,MONITOR: EXTBAN=$,ajrxz :are supported by this server") + (0.01 ":cadmium.libera.chat 251 tester :There are 70 users and 42996 invisible on 28 servers") + (0.02 ":cadmium.libera.chat 252 tester 38 :IRC Operators online") + (0.01 ":cadmium.libera.chat 253 tester 57 :unknown connection(s)") + (0.01 ":cadmium.libera.chat 254 tester 22912 :channels formed") + (0.01 ":cadmium.libera.chat 255 tester :I have 2499 clients and 1 servers") + (0.01 ":cadmium.libera.chat 265 tester 2499 4187 :Current local users 2499, max 4187") + (0.01 ":cadmium.libera.chat 266 tester 43066 51827 :Current global users 43066, max 51827") + (0.01 ":cadmium.libera.chat 250 tester :Highest connection count: 4188 (4187 clients) (319420 connections received)") + (0.01 ":cadmium.libera.chat 375 tester :- cadmium.libera.chat Message of the Day - ") + (0.01 ":cadmium.libera.chat 372 tester :- This server kindly provided by Mach Dilemma (www.m-d.net)") + (0.01 ":cadmium.libera.chat 372 tester :- Welcome to Libera Chat, the IRC network for") + (0.00 ":cadmium.libera.chat 372 tester :- Email: support@libera.chat") + (0.00 ":cadmium.libera.chat 376 tester :End of /MOTD command.") + (0.00 ":tester MODE tester :+Ziw") + (0.02 ":SaslServ!SaslServ@services.libera.chat NOTICE tester :Last login from: \2~tester@127.0.0.1\2 on Apr 07 01:02:11 2023 +0000.")) + +((mode 10 "MODE tester +i")) + +((join 10 "JOIN #test") + (0.09 ":tester!~tester@127.0.0.1 JOIN #test")) + +((mode 10 "MODE #test") + (0.03 ":cadmium.libera.chat 353 tester = #test :tester zbyqbepbqre7 pusevgfpu Thrfg2187 zngbeb qnexNssvavgl wrebzr- rqpentt Ilehf grfg2 AvtugZbaxrl pevfgvvbna xrivap_ fnvybePng shohxv gxan arrqyr avpx16 NeanhqW_kzcc Lbevpx_ hafcrag__ wfgbxre flfqrs RcvpArb Xbentt jvyyr cnefavc0 Wnarg wrnaogeq") + (0.02 ":cadmium.libera.chat 366 tester #test :End of /NAMES list.") + (0.00 ":cadmium.libera.chat 324 tester #test +nt") + (0.01 ":cadmium.libera.chat 329 tester #test 1621432263")) + +((drop 0 DROP)) diff --git a/test/lisp/erc/resources/services/regain/taken-ghost.eld b/test/lisp/erc/resources/services/regain/taken-ghost.eld new file mode 100644 index 00000000000..d5afd124a43 --- /dev/null +++ b/test/lisp/erc/resources/services/regain/taken-ghost.eld @@ -0,0 +1,42 @@ +;; -*- mode: lisp-data; -*- +((cap 10 "CAP REQ :sasl") + (0.00 ":irc.example.net NOTICE * :*** Looking up your hostname...") + (0.01 ":irc.example.net NOTICE * :*** Could not resolve your hostname: Domain not found; using your IP address (10.0.2.100) instead.")) +((nick 10 "NICK dummy")) +((user 10 "USER dummy 0 * :tester")) +((authenticate 10 "AUTHENTICATE PLAIN") + (0.00 ":irc.example.net CAP * ACK :sasl") + (0.03 ":irc.example.net 433 * dummy :Nickname is already in use.") + (0.04 "AUTHENTICATE :+")) +((nick 10 "NICK dummy`") + (0.00 "PING :orrMOjk^|V")) +((~pong 10 "PONG :orrMOjk^|V")) +((authenticate 10 "AUTHENTICATE AHRlc3RlcgBjaGFuZ2VtZQ==") + (0.01 ":irc.example.net 900 dummy` dummy`!dummy@10.0.2.100 tester :You are now logged in as tester") + (0.01 ":irc.example.net 903 dummy` :SASL authentication successful")) +((cap 10 "CAP END") + (0.00 ":irc.example.net 001 dummy` :Welcome to the FooNet IRC Network dummy`!dummy@10.0.2.100") + (0.03 ":irc.example.net 002 dummy` :Your host is irc.example.net, running version InspIRCd-3") + (0.01 ":irc.example.net 003 dummy` :This server was created 13:01:55 Jun 08 2023") + (0.01 ":irc.example.net 004 dummy` irc.example.net InspIRCd-3 BIRcgikorsw ACHIKMORTXabcefghijklmnopqrstvz :HIXabefghjkloqv") + (0.00 ":irc.example.net 005 dummy` ACCEPT=30 AWAYLEN=200 BOT=B CALLERID=g CASEMAPPING=ascii CHANLIMIT=#:20 CHANMODES=IXbeg,k,Hfjl,ACKMORTcimnprstz CHANNELLEN=64 CHANTYPES=# ELIST=CMNTU ESILENCE=CcdiNnPpTtx EXCEPTS=e :are supported by this server") + (0.01 ":irc.example.net 005 dummy` EXTBAN=,ACORTUacjrwz HOSTLEN=64 INVEX=I KEYLEN=32 KICKLEN=255 LINELEN=512 MAXLIST=I:100,X:100,b:100,e:100,g:100 MAXTARGETS=20 MODES=20 MONITOR=30 NAMELEN=128 NAMESX NETWORK=FooNet :are supported by this server") + (0.01 ":irc.example.net 005 dummy` NICKLEN=30 PREFIX=(qaohv)~&@%+ SAFELIST SILENCE=32 STATUSMSG=~&@%+ TOPICLEN=307 UHNAMES USERIP USERLEN=10 USERMODES=,,s,BIRcgikorw WHOX :are supported by this server") + (0.01 ":irc.example.net 251 dummy` :There are 2 users and 1 invisible on 2 servers") + (0.01 ":irc.example.net 253 dummy` 1 :unknown connections") + (0.00 ":irc.example.net 254 dummy` 1 :channels formed") + (0.00 ":irc.example.net 255 dummy` :I have 3 clients and 1 servers") + (0.00 ":irc.example.net 265 dummy` :Current local users: 3 Max: 4") + (0.00 ":irc.example.net 266 dummy` :Current global users: 3 Max: 4") + (0.00 ":irc.example.net 375 dummy` :irc.example.net message of the day") + (0.00 ":irc.example.net 372 dummy` : Have fun with the image!") + (0.00 ":irc.example.net 376 dummy` :End of message of the day.")) + +((mode 10 "MODE dummy` +i")) +((privmsg 10 "PRIVMSG NickServ :GHOST dummy") + (0.00 ":irc.example.net 501 dummy` x :is not a recognised user mode.") + (0.00 ":irc.example.net NOTICE dummy` :*** You are connected to irc.example.net using TLS (SSL) cipher 'TLS1.3-ECDHE-RSA-AES-256-GCM-AEAD'") + (0.03 ":dummy`!dummy@10.0.2.100 MODE dummy` :+i") + (0.02 ":NickServ!NickServ@services.int NOTICE dummy` :\2dummy\2 has been ghosted.")) +((nick 10 "NICK dummy") + (0.02 ":dummy`!dummy@10.0.2.100 NICK :dummy")) diff --git a/test/lisp/erc/resources/services/regain/taken-regain.eld b/test/lisp/erc/resources/services/regain/taken-regain.eld new file mode 100644 index 00000000000..22635d4cc89 --- /dev/null +++ b/test/lisp/erc/resources/services/regain/taken-regain.eld @@ -0,0 +1,42 @@ +;; -*- mode: lisp-data; -*- +((cap 10 "CAP REQ :sasl") + (0.00 ":irc.example.net NOTICE * :*** Looking up your hostname...") + (0.01 ":irc.example.net NOTICE * :*** Could not resolve your hostname: Domain not found; using your IP address (10.0.2.100) instead.")) +((nick 10 "NICK dummy")) +((user 10 "USER dummy 0 * :tester")) +;; This also happens to a test late ACK (see ghost variant for server-sent PING) +((authenticate 10 "AUTHENTICATE PLAIN") + (0.00 ":irc.example.net CAP * ACK :sasl") + (0.09 ":irc.example.net 433 * dummy :Nickname is already in use.") + (0.04 "AUTHENTICATE :+")) +((nick 10 "NICK dummy`")) +((authenticate 10 "AUTHENTICATE AHRlc3RlcgBjaGFuZ2VtZQ==") + (0.00 ":irc.example.net 900 dummy` dummy`!dummy@10.0.2.100 tester :You are now logged in as tester") + (0.01 ":irc.example.net 903 dummy` :SASL authentication successful")) + +((cap 10 "CAP END") + (0.00 ":irc.example.net 001 dummy` :Welcome to the FooNet IRC Network dummy`!dummy@10.0.2.100") + (0.02 ":irc.example.net 002 dummy` :Your host is irc.example.net, running version InspIRCd-3") + (0.02 ":irc.example.net 003 dummy` :This server was created 08:16:52 Jun 08 2023") + (0.01 ":irc.example.net 004 dummy` irc.example.net InspIRCd-3 BIRcgikorsw ACHIKMORTXabcefghijklmnopqrstvz :HIXabefghjkloqv") + (0.00 ":irc.example.net 005 dummy` ACCEPT=30 AWAYLEN=200 BOT=B CALLERID=g CASEMAPPING=ascii CHANLIMIT=#:20 CHANMODES=IXbeg,k,Hfjl,ACKMORTcimnprstz CHANNELLEN=64 CHANTYPES=# ELIST=CMNTU ESILENCE=CcdiNnPpTtx EXCEPTS=e :are supported by this server") + (0.01 ":irc.example.net 005 dummy` EXTBAN=,ACORTUacjrwz HOSTLEN=64 INVEX=I KEYLEN=32 KICKLEN=255 LINELEN=512 MAXLIST=I:100,X:100,b:100,e:100,g:100 MAXTARGETS=20 MODES=20 MONITOR=30 NAMELEN=128 NAMESX NETWORK=FooNet :are supported by this server") + (0.01 ":irc.example.net 005 dummy` NICKLEN=30 PREFIX=(qaohv)~&@%+ SAFELIST SILENCE=32 STATUSMSG=~&@%+ TOPICLEN=307 UHNAMES USERIP USERLEN=10 USERMODES=,,s,BIRcgikorw WHOX :are supported by this server") + (0.01 ":irc.example.net 251 dummy` :There are 2 users and 1 invisible on 2 servers") + (0.01 ":irc.example.net 253 dummy` 1 :unknown connections") + (0.00 ":irc.example.net 254 dummy` 1 :channels formed") + (0.02 ":irc.example.net 255 dummy` :I have 3 clients and 1 servers") + (0.00 ":irc.example.net 265 dummy` :Current local users: 3 Max: 4") + (0.00 ":irc.example.net 266 dummy` :Current global users: 3 Max: 4") + (0.00 ":irc.example.net 375 dummy` :irc.example.net message of the day") + (0.00 ":irc.example.net 372 dummy` : Have fun with the image!") + (0.00 ":irc.example.net 376 dummy` :End of message of the day.") + (0.00 ":irc.example.net 501 dummy` x :is not a recognised user mode.") + (0.00 ":irc.example.net NOTICE dummy` :*** You are connected to irc.example.net using TLS (SSL) cipher 'TLS1.3-ECDHE-RSA-AES-256-GCM-AEAD'")) + +((mode 10 "MODE dummy` +i")) + +((privmsg 10 "PRIVMSG NickServ :REGAIN dummy") + (0.00 ":dummy`!dummy@10.0.2.100 MODE dummy` :+i") + (0.02 ":NickServ!NickServ@services.int NOTICE dummy` :\2dummy\2 has been regained.") + (0.02 ":dummy`!dummy@10.0.2.100 NICK :dummy")) -- 2.40.1 --=-=-=-- From debbugs-submit-bounces@debbugs.gnu.org Tue Jul 04 02:16:34 2023 Received: (at control) by debbugs.gnu.org; 4 Jul 2023 06:16:34 +0000 Received: from localhost ([127.0.0.1]:34857 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qGZL0-0003sf-Fx for submit@debbugs.gnu.org; Tue, 04 Jul 2023 02:16:34 -0400 Received: from mail-108-mta234.mxroute.com ([136.175.108.234]:34775) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qGZKw-0003sS-2e for control@debbugs.gnu.org; Tue, 04 Jul 2023 02:16:33 -0400 Received: from mail-111-mta2.mxroute.com ([136.175.111.2] filter006.mxroute.com) (Authenticated sender: mN4UYu2MZsgR) by mail-108-mta234.mxroute.com (ZoneMTA) with ESMTPSA id 1891f8b903e0007ced.001 for (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384); Tue, 04 Jul 2023 06:16:27 +0000 X-Zone-Loop: 6401b7edec938596d2e502449cfac34421784f2ecd50 X-Originating-IP: [136.175.111.2] 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:Date:Subject:To:From:Sender: Reply-To:Cc:Content-Transfer-Encoding:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: In-Reply-To:References:List-Id:List-Help:List-Unsubscribe:List-Subscribe: List-Post:List-Owner:List-Archive; bh=wEslco+W/yEWHzyFOK0+TA08cmEC6hRzVNar4wkw0NU=; b=ccrQQZVLppeFvPQCgXRfyVv2jW DaxQPxJS1Bsi2U1puxcUvWZbNgDh8YhytQrH71BX61gqEA4qUPy35C+woVMPQOz8nOQDXTCQ/+0oU KfO1Tw1nKzBp9WcAnckECx9Fw8trb9JfMiE/q94WMEZFsF+8c68BXBELMoSXBWEaRR1ShRlvOUquH LVzgSYtecSoqTbbSZEJrijIoygX0EoPrO2qewI33JQgk69tP5Yd+OVz2wfESNlorpvVHr12BLEz9F F2s/Kb/gr971NUZe0+dSi0f04HJA54vPzKoHHkooJnWIooSqmYUb47PKrXeLEg3lXw1T3myMftnnn uFDhJyjw==; From: "J.P." To: control@debbugs.gnu.org Subject: control message for bug #63973 Date: Mon, 03 Jul 2023 23:16:23 -0700 Message-ID: <87pm58mcaw.fsf@neverwas.me> MIME-Version: 1.0 Content-Type: text/plain X-Authenticated-Id: masked@neverwas.me X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: control X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) close 63973 30.1 quit Installed as 6ce957154b7 "Redo erc-nickname-in-use-functions as a local module". From unknown Wed Jun 18 21:13:19 2025 Received: (at fakecontrol) by fakecontrolmessage; To: internal_control@debbugs.gnu.org From: Debbugs Internal Request Subject: Internal Control Message-Id: bug archived. Date: Tue, 01 Aug 2023 11:24:07 +0000 User-Agent: Fakemail v42.6.9 # This is a fake control message. # # The action: # bug archived. thanks # This fakemail brought to you by your local debbugs # administrator