emacs-devel
[Top][All Lists]
Advanced

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

[PATCH] Prevent ERC from sending spurious PART messages


From: Victor J. Orlikowski
Subject: [PATCH] Prevent ERC from sending spurious PART messages
Date: Thu, 30 Mar 2017 15:41:32 -0400
User-agent: Notmuch/0.22.2 (http://notmuchmail.org) Emacs/25.1.1 (x86_64-apple-darwin15.6.0)

In the existing code, ERC can send a spurious PART message to the
server, if a given channel has already been closed, through the
operation of erc-channel-hook. The following patch ensures that
erc-channel-hook checks to see that the channel is still live,
before sending the PART message.

>From 05994f7f170bd75c9af6b1990d6d7ce1b9a28875 Mon Sep 17 00:00:00 2001
From: "Victor J. Orlikowski" <address@hidden>
Date: Thu, 30 Mar 2017 13:13:34 -0400
Subject: [PATCH 2/2] Ensure that PART doesn't get sent to an already-PARTed
 channel.

---
 lisp/erc/erc.el | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)

diff --git a/lisp/erc/erc.el b/lisp/erc/erc.el
index 488404d..357d03c 100644
--- a/lisp/erc/erc.el
+++ b/lisp/erc/erc.el
@@ -6735,9 +6735,10 @@ This function should be on `erc-kill-server-hook'."
 This function should be on `erc-kill-channel-hook'."
   (when (erc-server-process-alive)
     (let ((tgt (erc-default-target)))
-      (erc-server-send (format "PART %s :%s" tgt
-                               (funcall erc-part-reason nil))
-                       nil tgt))))
+      (unless (not tgt)
+       (erc-server-send (format "PART %s :%s" tgt
+                                (funcall erc-part-reason nil))
+                        nil tgt)))))
 
 ;;; Dealing with `erc-parsed'
 
-- 
2.10.1 (Apple Git-78)


Best,
Victor
-- 
Victor J. Orlikowski <> address@hidden



reply via email to

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