1From e8bda36978b91df532394a10e66589272f549959 Mon Sep 17 00:00:00 2001
2From: Michael Forney <mforney@mforney.org>
3Date: Thu, 19 Mar 2026 02:48:24 -0700
4Subject: [PATCH] Send CAP END on RPL_SASLSUCCESS
5
6soju does not send 900 RPL_LOGGEDIN after SASL authentication[0]
7in order to show the one from the upstream network.
8
9We already sent CAP END *unless* doing SASL, so it makes sense to
10look for 903 RPL_SASLSUCCESS to send CAP END when we *are* doing
11SASL.
12
13[0] https://github.com/ircv3/ircv3-specifications/pull/476
14---
15 handle.c | 4 ++--
16 1 file changed, 2 insertions(+), 2 deletions(-)
17
18diff --git a/handle.c b/handle.c
19index b973161..1c13343 100644
20--- a/handle.c
21+++ b/handle.c
22@@ -252,7 +252,7 @@ static void handleAuthenticate(struct Message *msg) {
23 explicit_bzero(self.plainPass, strlen(self.plainPass));
24 }
25
26-static void handleReplyLoggedIn(struct Message *msg) {
27+static void handleReplySASLSuccess(struct Message *msg) {
28 (void)msg;
29 ircFormat("CAP END\r\n");
30 handleReplyGeneric(msg);
31@@ -1403,7 +1403,7 @@ static const struct Handler {
32 { "704", +ReplyHelp, handleReplyHelp },
33 { "705", +ReplyHelp, handleReplyHelp },
34 { "706", -ReplyHelp, NULL },
35- { "900", 0, handleReplyLoggedIn },
36+ { "903", 0, handleReplySASLSuccess },
37 { "904", 0, handleErrorSASLFail },
38 { "905", 0, handleErrorSASLFail },
39 { "906", 0, handleErrorSASLFail },
40--
412.49.0
42