Send CAP END if CAP LS doesn't list anything good

master
C. McEnroe 2020-02-06 03:44:49 -05:00
parent 306e2b5c5b
commit 1e6e533538
1 changed files with 5 additions and 1 deletions

View File

@ -98,7 +98,11 @@ static void handleCap(struct Message *msg) {
enum Cap caps = capParse(msg->params[2]);
if (!strcmp(msg->params[1], "LS")) {
caps &= ~CapSASL;
ircFormat("CAP REQ :%s\r\n", capList(caps));
if (caps) {
ircFormat("CAP REQ :%s\r\n", capList(caps));
} else {
if (!(self.caps & CapSASL)) ircFormat("CAP END\r\n");
}
} else if (!strcmp(msg->params[1], "ACK")) {
self.caps |= caps;
if (caps & CapSASL) {