* net/rcirc.el (rcirc-handler-001): Only authenticate, if there's
authorTassilo Horn <tassilo@member.fsf.org>
Thu, 31 Mar 2011 12:19:17 +0000 (14:19 +0200)
committerTassilo Horn <tassilo@member.fsf.org>
Thu, 31 Mar 2011 12:19:17 +0000 (14:19 +0200)
an entry for that server in rcirc-authinfo. (Bug#8385)

lisp/ChangeLog
lisp/net/rcirc.el

index 933eb2b..8c42864 100644 (file)
@@ -1,3 +1,8 @@
+2011-03-31  Tassilo Horn  <tassilo@member.fsf.org>
+
+       * net/rcirc.el (rcirc-handler-001): Only authenticate, if there's
+       an entry for that server in rcirc-authinfo. (Bug#8385)
+
 2011-03-31  Glenn Morris  <rgm@gnu.org>
 
        * progmodes/f90.el (f90-find-tag-default): Handle multiple `%'.
index eb4ad01..5822fc3 100644 (file)
@@ -2454,7 +2454,15 @@ keywords when no KEYWORD is given."
     (setq rcirc-nick (car args))
     (rcirc-update-prompt)
     (if rcirc-auto-authenticate-flag
-        (if rcirc-authenticate-before-join
+        (if (and rcirc-authenticate-before-join
+                ;; We have to ensure that there's an authentication
+                ;; entry for that server.  Else,
+                ;; rcirc-authenticated-hook won't be triggered, and
+                ;; autojoin won't happen at all.
+                (let (auth-required)
+                  (dolist (s rcirc-authinfo auth-required)
+                    (when (string-match (car s) rcirc-server-name)
+                      (setq auth-required t)))))
             (progn
              (add-hook 'rcirc-authenticated-hook 'rcirc-join-channels-post-auth t t)
               (rcirc-authenticate))