[Top][All Lists]

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

bug#12002: 24.1.50; ERC nick change trouble

From: Antoine Levitt
Subject: bug#12002: 24.1.50; ERC nick change trouble
Date: Sat, 21 Jul 2012 00:56:25 +0200
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/24.1.50 (gnu/linux)


There's a bug in ERC nick change handling. Imagine you have a query with
john, who has a timeout. He then comes back as john-, and queries
you. Then, when his old timeout goes away, he changes nick back to
john. The ERC response handler then tries to change the john- query
buffer name to john, which clashes with the old buffer. Since there was
an error in the execution flow, everything is messed up.

Here's a patch that doesn't try to change the name back when a buffer of
the same name exists. It still notifies the old query buffer of the name
change though. I haven't tested it but it should be fine. (I think ...)

I'm not holding my breath on this, because of the lack of activity of
ERC maintainers. Still, at least the patch is out there.

diff --git a/lisp/erc/erc-backend.el b/lisp/erc/erc-backend.el
index cce24e6..115c31f 100644
--- a/lisp/erc/erc-backend.el
+++ b/lisp/erc/erc-backend.el
@@ -1313,10 +1313,11 @@ add things to `%s' instead."
        (lambda ()
          (when (equal (erc-default-target) nick)
-           (setq erc-default-recipients
-                 (cons nn (cdr erc-default-recipients)))
-           (rename-buffer nn)
-           (erc-update-mode-line)
+           (unless (get-buffer nn)
+             (setq erc-default-recipients
+                   (cons nn (cdr erc-default-recipients)))
+             (rename-buffer nn)
+             (erc-update-mode-line))
            (add-to-list 'bufs (current-buffer)))))
       (erc-update-user-nick nick nn host nil nil login)

reply via email to

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