summary refs log tree commit diff
path: root/state.c
diff options
context:
space:
mode:
authorJune McEnroe <june@causal.agency>2019-10-26 22:15:47 -0400
committerJune McEnroe <june@causal.agency>2019-10-26 22:15:47 -0400
commit437162dca3dff21272328908054b37b19351a228 (patch)
treefccdb95a24d24398356d5dfa0986fefcc27d34b0 /state.c
parentRespond to PING with same parameter (diff)
downloadpounce-437162dca3dff21272328908054b37b19351a228.tar.gz
pounce-437162dca3dff21272328908054b37b19351a228.zip
Wait for AUTHENTICATE + from server
Diffstat (limited to 'state.c')
-rw-r--r--state.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/state.c b/state.c
index fa9c77b..ee3ae78 100644
--- a/state.c
+++ b/state.c
@@ -122,6 +122,11 @@ static void handleCap(struct Message *msg) {
 	bool ack = msg->params[1] && !strcmp(msg->params[1], "ACK");
 	bool sasl = msg->params[2] && !strncmp(msg->params[2], "sasl", 4);
 	if (!ack || !sasl) errx(EX_CONFIG, "server does not support SASL");
+	serverFormat("AUTHENTICATE PLAIN\r\n");
+}
+
+static void handleAuthenticate(struct Message *msg) {
+	(void)msg;
 	serverAuth();
 }
 
@@ -221,6 +226,7 @@ static const struct {
 	{ "004", handleReplyMyInfo },
 	{ "005", handleReplyISupport },
 	{ "332", handleReplyTopic },
+	{ "AUTHENTICATE", handleAuthenticate },
 	{ "CAP", handleCap },
 	{ "ERROR", handleError },
 	{ "JOIN", handleJoin },