summary refs log tree commit diff
path: root/state.c
diff options
context:
space:
mode:
authorJune McEnroe <june@causal.agency>2020-02-27 02:56:54 -0500
committerJune McEnroe <june@causal.agency>2020-02-27 02:56:54 -0500
commit21bb677c1f395541a1b0610a0f576d58ce778273 (patch)
tree5860433bdc64a69a677926f7ba48bd6da78a508d /state.c
parentProperly treat CAP LS version as a number (diff)
downloadpounce-21bb677c1f395541a1b0610a0f576d58ce778273.tar.gz
pounce-21bb677c1f395541a1b0610a0f576d58ce778273.zip
Send CAP LS 302 to the server
Diffstat (limited to 'state.c')
-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);