unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: Martin Kletzander <nert.pinx@gmail.com>
To: Kevin Brubeck Unhammer <unhammer@fsfe.org>
Cc: Lars Ingebrigtsen <larsi@gnus.org>, 32723@debbugs.gnu.org
Subject: bug#32723: [PATCH] Fix erc-autojoin for same channel names on multiple servers
Date: Tue, 19 May 2020 20:25:24 +0200	[thread overview]
Message-ID: <20200519182524.GE926@wheatley> (raw)
In-Reply-To: <20200511150654.GF30179@wheatley>

On Mon, May 11, 2020 at 05:06:54PM +0200, Martin Kletzander wrote:
>On Sun, May 10, 2020 at 09:32:38PM +0200, Kevin Brubeck Unhammer wrote:
>>Martin Kletzander <nert.pinx@gmail.com> čá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?
>>

So I just tried emacs-27.0.91 and with your approach it does not join any
channel on any server.  With my patch (which I just learned is in, I found out
that it could not be applied locally) it joins all channels, but there is only
one of those two that have the same name.  However if I try joining the other
one manually it joins, but does not create a buffer.  It only gets created once
someone posts to the channel.  I actually started writing that it does not get
joined while a message appeared out of nowhere, I thought it was a private query
because there was no header, nothing.  Only after that I realised it has a name
of the channel, but on the second server, so I deleted that part of the e-mail!

I think there is something wrong with some other part of erc-join (or erc), so
for a while I'm sticking to 26.* with my patch on top of it, but sooner or later
I'll have to figure that out (or someone else, maybe).  Unfortunately I'm
swamped with more important things lately.

>
>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





  reply	other threads:[~2020-05-19 18:25 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-09-12 15:44 bug#32723: [PATCH] Fix erc-autojoin for same channel names on multiple servers Martin Kletzander
2019-06-23 21:53 ` Lars Ingebrigtsen
2020-05-10 19:45 ` Kevin Brubeck Unhammer
     [not found] ` <87ftc7h9gp.fsf@fsfe.org>
2020-05-11 15:06   ` Martin Kletzander
2020-05-19 18:25     ` Martin Kletzander [this message]
2020-05-19 18:40       ` Kevin Brubeck Unhammer
2020-05-19 20:32         ` Corwin Brust
2020-06-09 14:52           ` Martin Kletzander

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20200519182524.GE926@wheatley \
    --to=nert.pinx@gmail.com \
    --cc=32723@debbugs.gnu.org \
    --cc=larsi@gnus.org \
    --cc=unhammer@fsfe.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).