summaryrefslogtreecommitdiff
path: root/lisp/erc
diff options
context:
space:
mode:
authorLars Ingebrigtsen <larsi@gnus.org>2015-12-27 20:25:57 +0100
committerLars Ingebrigtsen <larsi@gnus.org>2015-12-27 20:26:22 +0100
commit504982765cc563d96a0b773f4cf183ceacaf5861 (patch)
tree5049c85e50523a8c0acd3e2e115f44abdb3452a2 /lisp/erc
parent3ad99c4674e670b73e7dcd8de3fa00b6dec4448f (diff)
downloademacs-504982765cc563d96a0b773f4cf183ceacaf5861.tar.gz
Don't join erc channels doubly
* erc-join.el (erc-autojoin-channels): Don't join channels more than once (if you have several nicks) (bug#20695).
Diffstat (limited to 'lisp/erc')
-rw-r--r--lisp/erc/erc-join.el10
1 files changed, 8 insertions, 2 deletions
diff --git a/lisp/erc/erc-join.el b/lisp/erc/erc-join.el
index 4c99898bc41..c1ce14ab016 100644
--- a/lisp/erc/erc-join.el
+++ b/lisp/erc/erc-join.el
@@ -156,7 +156,13 @@ This function is run from `erc-nickserv-identified-hook'."
(dolist (l erc-autojoin-channels-alist)
(when (string-match (car l) server)
(dolist (chan (cdr l))
- (erc-server-join-channel server chan)))))
+ (let ((buffer (erc-get-buffer chan)))
+ ;; Only auto-join the channels that we aren't already in
+ ;; using a different nick.
+ (when (or (not buffer)
+ (not (with-current-buffer buffer
+ (erc-server-process-alive))))
+ (erc-server-join-channel server chan)))))))
;; Return nil to avoid stomping on any other hook funcs.
nil)
@@ -170,7 +176,7 @@ This function is run from `erc-nickserv-identified-hook'."
(password (if (functionp secret)
(funcall secret)
secret)))
- (erc-server-send (concat "join " channel
+ (erc-server-send (concat "JOIN " channel
(if password
(concat " " password)
"")))))