From 55dcd32ad2209dc34bfb6b713bf73be9bf4c4cb2 Mon Sep 17 00:00:00 2001 From: Leo Liu Date: Mon, 7 Oct 2019 18:52:33 +0800 Subject: [PATCH] Fix rcirc not to interpret nil as nickname (bug#37344) * lisp/net/rcirc.el (rcirc-send-privmsg): Type check `target'. (rcirc-cmd-me): Send CTCP only when `target' exists. --- lisp/net/rcirc.el | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/lisp/net/rcirc.el b/lisp/net/rcirc.el index de524d9ef10..d95db26cae9 100644 --- a/lisp/net/rcirc.el +++ b/lisp/net/rcirc.el @@ -825,6 +825,7 @@ Function is called with PROCESS, COMMAND, SENDER, ARGS and LINE.") (process-send-string process string))) (defun rcirc-send-privmsg (process target string) + (cl-check-type target string) (rcirc-send-string process (format "PRIVMSG %s :%s" target string))) (defun rcirc-send-ctcp (process target request &optional args) @@ -2337,8 +2338,8 @@ With a prefix arg, prompt for new topic." (let ((timestamp (format-time-string "%s"))) (rcirc-send-ctcp process target "PING" timestamp))) -(defun rcirc-cmd-me (args &optional process target) - (rcirc-send-ctcp process target "ACTION" args)) +(defun rcirc-cmd-me (args process target) + (when target (rcirc-send-ctcp process target "ACTION" args))) (defun rcirc-add-or-remove (set &rest elements) (dolist (elt elements) -- 2.39.2