From 1829dc40c6c3af3768a9feaa99f4aabbb34eca23 Mon Sep 17 00:00:00 2001 From: "C. McEnroe" Date: Mon, 21 Dec 2020 15:29:10 -0500 Subject: Send CAP END if CAP LS response is empty Or only unsupported caps. Or, as the corresponding commit in catgirl says, "if CAP LS doesn't list anything good." --- state.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/state.c b/state.c index 14af068..41ffdd0 100644 --- a/state.c +++ b/state.c @@ -90,7 +90,11 @@ static void handleCap(struct Message *msg) { if (!strcmp(msg->params[1], "LS") || !strcmp(msg->params[1], "NEW")) { caps &= ~(CapSASL | CapSTS | CapUnsupported); - if (caps) serverFormat("CAP REQ :%s\r\n", capList(caps, NULL)); + if (caps) { + serverFormat("CAP REQ :%s\r\n", capList(caps, NULL)); + } else { + if (!(stateCaps & CapSASL)) serverFormat("CAP END\r\n"); + } } else if (!strcmp(msg->params[1], "ACK")) { stateCaps |= caps; -- cgit 1.4.1