]> git.eshelyaron.com Git - emacs.git/commitdiff
Send CAP END after authentication has been successful
authorAlex McGrath <amk@amk.ie>
Tue, 29 Jun 2021 11:06:22 +0000 (12:06 +0100)
committerTassilo Horn <tsdh@gnu.org>
Tue, 29 Jun 2021 11:41:28 +0000 (13:41 +0200)
lisp/net/rcirc.el

index 0feafd708abd364db9b69a968237d5109a44d337..d1b87abb62be721d2e3874c2232aa7d00f28ca24 100644 (file)
@@ -657,8 +657,6 @@ that are joined after authentication."
                      (or server-alias server) nil server port-number
                      :type (or encryption 'plain))))
       ;; set up process
-      (when use-sasl
-        (setq-local rcirc-finished-sasl nil))
       (set-process-coding-system process 'raw-text 'raw-text)
       (switch-to-buffer (rcirc-generate-new-buffer-name process nil))
       (set-process-buffer process (current-buffer))
@@ -682,6 +680,8 @@ that are joined after authentication."
 
       (add-hook 'auto-save-hook 'rcirc-log-write)
 
+      (when use-sasl
+        (setq-local rcirc-finished-sasl nil))
       ;; identify
       (dolist (cap rcirc-implemented-capabilities)
         (rcirc-send-string process "CAP" "REQ" : cap)
@@ -3509,9 +3509,14 @@ PROCESS is the process object for the current connection."
    (base64-encode-string
     ;; use connection user-name
     (concat "\0" (nth 3 rcirc-connection-info)
-            "\0" (rcirc-get-server-password rcirc-server))))
-  (setq-local rcirc-finished-sasl t)
-  (rcirc-send-string process "CAP" "END"))
+            "\0" (rcirc-get-server-password rcirc-server)))))
+
+(defun rcirc-handler-900 (process sender args _text)
+  "Respond to a successful authentication response"
+  (rcirc-handler-generic process "900" sender args nil)
+  (when (not rcirc-finished-sasl)
+    (setq-local rcirc-finished-sasl t)
+    (rcirc-send-string process "CAP" "END")))
 
 \f
 (defgroup rcirc-faces nil