From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.ciao.gmane.io!not-for-mail From: Martin Kletzander Newsgroups: gmane.emacs.bugs Subject: bug#32723: [PATCH] Fix erc-autojoin for same channel names on multiple servers Date: Mon, 11 May 2020 17:06:54 +0200 Message-ID: <20200511150654.GF30179@wheatley> References: <1ea700cd1f4f6a80dd1315c8192361bd09d1eadd.1536767069.git.nert.pinx@gmail.com> <87ftc7h9gp.fsf@fsfe.org> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit Injection-Info: ciao.gmane.io; posting-host="ciao.gmane.io:159.69.161.202"; logging-data="87399"; mail-complaints-to="usenet@ciao.gmane.io" Cc: Lars Ingebrigtsen , 32723@debbugs.gnu.org To: Kevin Brubeck Unhammer Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Mon May 11 17:10:01 2020 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 1jYA45-000MTW-TL for geb-bug-gnu-emacs@m.gmane-mx.org; Mon, 11 May 2020 17:09:57 +0200 Original-Received: from localhost ([::1]:56406 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jYA44-00026Y-Qo for geb-bug-gnu-emacs@m.gmane-mx.org; Mon, 11 May 2020 11:09:56 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:36704) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jYA2E-0008N1-OV for bug-gnu-emacs@gnu.org; Mon, 11 May 2020 11:08:02 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:41416) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1jYA2E-0003lZ-DY for bug-gnu-emacs@gnu.org; Mon, 11 May 2020 11:08:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1jYA2E-000682-8Q for bug-gnu-emacs@gnu.org; Mon, 11 May 2020 11:08:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Martin Kletzander Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Mon, 11 May 2020 15:08:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 32723 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch fixed Original-Received: via spool by 32723-submit@debbugs.gnu.org id=B32723.158920962423453 (code B ref 32723); Mon, 11 May 2020 15:08:02 +0000 Original-Received: (at 32723) by debbugs.gnu.org; 11 May 2020 15:07:04 +0000 Original-Received: from localhost ([127.0.0.1]:52959 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1jYA1I-00066D-92 for submit@debbugs.gnu.org; Mon, 11 May 2020 11:07:04 -0400 Original-Received: from mail-wm1-f52.google.com ([209.85.128.52]:38378) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1jYA1G-00065Z-Ow for 32723@debbugs.gnu.org; Mon, 11 May 2020 11:07:03 -0400 Original-Received: by mail-wm1-f52.google.com with SMTP id g12so19694881wmh.3 for <32723@debbugs.gnu.org>; Mon, 11 May 2020 08:07:02 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:content-transfer-encoding:in-reply-to; bh=m9SCBobVRHfEFaPdfAlEAF+1HVQ5lRi+0IxGPcA0HOQ=; b=mm0RZYsqUnTCb7IV0U9W3XbaOYZBtMAtCNcPC/HDz1DpF7H712oRsK9ll/Fk0fZ4dn kGVDbGNSJd1tyZK/Z1o4e23gFAAL/ekL5k1VIXluGOg0Mh/0wACY83spZ6FZqvwI+2tf cGT0OIlnoRrIzqucg/xs1ej4yvEiCCon/Ll0Ikl3YQm2cDwga0/jxt3K7tUCJdgifGH6 x5BtMB2B9K+hI0Fjo3MsdMuUBF/1Js213HBu+FnA8aXmghH/jnpm/O/4au5Uj3o1/6LS 9A6GvTrDJU6k7nmCzKkv4rkrWJ+lJEj4KO9m0SD+IALl1pWUBZ5DzEgYJnsTSmdqhhUS T7ng== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:content-transfer-encoding :in-reply-to; bh=m9SCBobVRHfEFaPdfAlEAF+1HVQ5lRi+0IxGPcA0HOQ=; b=LJmxvFQIiI32L7KpB4C8XD587BdDOj7JHi55YplEzT7LDlp4BuF1rq/S5i8JuGskj2 9JJAPLUYVPq02Vq8G5U9QmbgYkXzj6YgBR4K4Q4e8bABuC6M5LlVb4iseKi1JxlO9sHL m71An3QfViwLEVVObFYRPSA48UYqlIAWiKzDSjMM5eMUNFg5U9OKId9GeBHC10h2TwYq WXWA5t7U/TwMYvTTKvNZmh7z+eacB9RnxaNcWcDmhiC2aBXHKUwJtW2NaLB0zaPLK4Xr ZxRRVKi0/QgepdFGPDG8T8AGrNnK81eH9uWXbFoTOzXA3RQbqOlGKT/TWvCscS7+s9zW uZBw== X-Gm-Message-State: AGi0PuYbXZRQt4lO+ncYG5fDKmrcDQGYGVcFItfxDaaGWifPXoHCQrCf mG9yBbNsH/j2kzdEAFLr9iFvjvKY X-Google-Smtp-Source: APiQypKxSDtbrE+fMdYumRIboCEEIiBwAHqC+YdiLfxl5bwK+fI8yTwgrDL78acjIiJ2sjsA7Js+/w== X-Received: by 2002:a7b:cbc6:: with SMTP id n6mr12757567wmi.34.1589209616530; Mon, 11 May 2020 08:06:56 -0700 (PDT) Original-Received: from carol.localdomain (k8r.cz. [95.82.177.71]) by smtp.gmail.com with ESMTPSA id n9sm5124490wmj.5.2020.05.11.08.06.55 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 11 May 2020 08:06:55 -0700 (PDT) Original-Received: by carol.localdomain (Postfix, from userid 1000) id C7D1CC2002A; Mon, 11 May 2020 17:06:54 +0200 (CEST) Content-Disposition: inline X-Clacks-Overhead: GNU Terry Pratchett In-Reply-To: <87ftc7h9gp.fsf@fsfe.org> 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:180066 Archived-At: On Sun, May 10, 2020 at 09:32:38PM +0200, Kevin Brubeck Unhammer wrote: >Martin Kletzander čálii: > >> When auto-joining channel with the same name on >> multiple channels the auto-join will go over the >> list of channels and for each one it checks if >> there is a buffer and alive server process. >> However it does not check if the server process >> matches the server being currently processed for >> auto-joining. >> >> This happens since commit "Don't join erc channels >> doubly" >> >> Fix it by checking if the currently processed >> server matches the erc process name of the already >> joined channel. > >That's not always going to match though. The car's of >erc-autojoin-channels contain the values of erc-server-announced-name or >erc-session-server, not the process-name of >erc-server-process. E.g. when I join my weechat relay, >erc-session-server is "example.com" and erc-server-announced-name is >"weechat.relay.irc" while (process-name erc-server-process) is >"erc-example.com-9001<1>". > Oh, I completely forgot what I was doing there, I just know that with this patch it is fixed for me, even though it might be dependent on various quirks that just happen on my client (be it joining servers with very different latency, not using autojoin twice or something completely different). >Also, the check is against the current erc-server-process (for the >server being joined). Isn't the intention of the patch to check against >the candidate buffer's server-process? > As I said, I do not remember what exactly was the reason for this particular way of dealing with it. I definitely made some mistakes. >I would expect something like > > (when (or (not buffer) > ;; If the same channel is joined on another > ;; server the best-effort is to just join > (not (with-current-buffer buffer > (or (string-match-p (car l) erc-session-server) > (string-match-p (car l) erc-session-announced-name)))) > (not (with-current-buffer buffer > (erc-server-process-alive)))) > (erc-server-join-channel server chan)) > If that works, then I'm fine with it. I can test it later on and let you know if it works for me. Thanks, Martin