diff options
| author | Lars Ingebrigtsen | 2015-12-27 20:25:57 +0100 |
|---|---|---|
| committer | Lars Ingebrigtsen | 2015-12-27 20:26:22 +0100 |
| commit | 504982765cc563d96a0b773f4cf183ceacaf5861 (patch) | |
| tree | 5049c85e50523a8c0acd3e2e115f44abdb3452a2 | |
| parent | 3ad99c4674e670b73e7dcd8de3fa00b6dec4448f (diff) | |
| download | emacs-504982765cc563d96a0b773f4cf183ceacaf5861.tar.gz emacs-504982765cc563d96a0b773f4cf183ceacaf5861.zip | |
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).
| -rw-r--r-- | lisp/erc/erc-join.el | 10 |
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'." | |||
| 156 | (dolist (l erc-autojoin-channels-alist) | 156 | (dolist (l erc-autojoin-channels-alist) |
| 157 | (when (string-match (car l) server) | 157 | (when (string-match (car l) server) |
| 158 | (dolist (chan (cdr l)) | 158 | (dolist (chan (cdr l)) |
| 159 | (erc-server-join-channel server chan))))) | 159 | (let ((buffer (erc-get-buffer chan))) |
| 160 | ;; Only auto-join the channels that we aren't already in | ||
| 161 | ;; using a different nick. | ||
| 162 | (when (or (not buffer) | ||
| 163 | (not (with-current-buffer buffer | ||
| 164 | (erc-server-process-alive)))) | ||
| 165 | (erc-server-join-channel server chan))))))) | ||
| 160 | ;; Return nil to avoid stomping on any other hook funcs. | 166 | ;; Return nil to avoid stomping on any other hook funcs. |
| 161 | nil) | 167 | nil) |
| 162 | 168 | ||
| @@ -170,7 +176,7 @@ This function is run from `erc-nickserv-identified-hook'." | |||
| 170 | (password (if (functionp secret) | 176 | (password (if (functionp secret) |
| 171 | (funcall secret) | 177 | (funcall secret) |
| 172 | secret))) | 178 | secret))) |
| 173 | (erc-server-send (concat "join " channel | 179 | (erc-server-send (concat "JOIN " channel |
| 174 | (if password | 180 | (if password |
| 175 | (concat " " password) | 181 | (concat " " password) |
| 176 | ""))))) | 182 | ""))))) |