summary refs log tree commit diff
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
parentRespond to PING with same parameter (diff)
downloadpounce-437162dca3dff21272328908054b37b19351a228.tar.gz
pounce-437162dca3dff21272328908054b37b19351a228.zip
Wait for AUTHENTICATE + from server
Diffstat (limited to '')
-rw-r--r--server.c7
-rw-r--r--state.c6
2 files changed, 7 insertions, 6 deletions
diff --git a/server.c b/server.c
index 3dec684..964b15b 100644
--- a/server.c
+++ b/server.c
@@ -159,12 +159,7 @@ void serverLogin(
 
 void serverAuth(void) {
 	assert(authPlain);
-	serverFormat(
-		"AUTHENTICATE PLAIN\r\n"
-		"AUTHENTICATE %s\r\n"
-		"CAP END\r\n",
-		authPlain
-	);
+	serverFormat("AUTHENTICATE %s\r\nCAP END\r\n", authPlain);
 	free(authPlain);
 	authPlain = NULL;
 }
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 },
2d95c3675252&follow=1'>Consolidate hilex formatters into hilex.cJune McEnroe 2021-01-12Remove hacky tagging from hilexJune McEnroe God that makes the lexers so much simpler. 2021-01-12Add htagml -iJune McEnroe 2021-01-12Render tag index in HTMLJune McEnroe 2021-01-12Add htagml -xJune McEnroe 2021-01-12Prevent matching the same tag twiceJune McEnroe 2021-01-12Process htagml file line by lineJune McEnroe This simplifies some things, adds support for line number tag definitions, and should enable combining htagml with other preprocessors in the future. 2021-01-12Split fields by tab onlyJune McEnroe Also don't fail hard on non-forward-search definitions. 2021-01-12List both Makefile and html.sh under README.7June McEnroe 2021-01-12Add htagml exampleJune McEnroe 2021-01-12Use mandoc and htagml for bin htmlJune McEnroe 2021-01-12Add htagmlJune McEnroe 2021-01-12Replace causal.agency with a simple mdoc pageJune McEnroe 2021-01-11Publish "Using vi"June McEnroe 2021-01-11Enable diff.colorMovedJune McEnroe 2021-01-10Set less search case-insensitiveJune McEnroe 2021-01-10Set EXINITJune McEnroe neovim is laggy as hell in my OpenBSD VM, so I switched to vi so I could type without getting frustrated. 2021-01-09Add c -t flag to print expression typeJune McEnroe Also add missing float case. 2021-01-05Update taglineJune McEnroe