summary refs log tree commit diff
path: root/state.c
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--state.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/state.c b/state.c
index 71c2763..d667971 100644
--- a/state.c
+++ b/state.c
@@ -48,7 +48,7 @@ void stateLogin(
 	const char *pass, bool sasl, const char *plain,
 	const char *nick, const char *user, const char *real
 ) {
-	serverFormat("CAP LS\r\n");
+	serverFormat("CAP LS 302\r\n");
 	if (pass) serverFormat("PASS :%s\r\n", pass);
 	if (sasl) {
 		serverFormat("CAP REQ :%s\r\n", capList(CapSASL, NULL));
@@ -72,7 +72,12 @@ void stateLogin(
 
 static void handleCap(struct Message *msg) {
 	require(msg, false, 3);
-	enum Cap caps = capParse(msg->params[2]);
+	enum Cap caps;
+	if (!strcmp(msg->params[2], "*") && msg->params[3]) {
+		caps = capParse(msg->params[3], NULL);
+	} else {
+		caps = capParse(msg->params[2], NULL);
+	}
 
 	if (!strcmp(msg->params[1], "LS") || !strcmp(msg->params[1], "NEW")) {
 		caps &= ~(CapSASL | CapUnsupported);