commit - da4c1ebe81bbd1335356ef40c91741b953c9f8d8
commit + 2327b17656b329d6210628f24c77f51533c05620
blob - 956b359930330347df3b601b8418ca762359f63f
blob + c92a3f392dd38fea3a3aa53ab225460dc3898ff2
--- src/ngircd/irc-cap.c
+++ src/ngircd/irc-cap.c
bool Handle_CAP_CLEAR PARAMS((CLIENT *Client));
bool Handle_CAP_END PARAMS((CLIENT *Client));
+void Set_CAP_Negotiation PARAMS((CLIENT *Client));
+
+
/**
* Handler for the IRCv3 "CAP" command.
*
{
assert(Client != NULL);
- if (Client_Type(Client) != CLIENT_USER)
- Client_CapAdd(Client, CLIENT_CAP_PENDING);
+ Set_CAP_Negotiation(Client);
- Client_CapAdd(Client, CLIENT_CAP_SUPPORTED);
return IRC_WriteStrClient(Client, "CAP %s LS :", Client_ID(Client));
}
assert(Client != NULL);
assert(Arg != NULL);
+ Set_CAP_Negotiation(Client);
+
return IRC_WriteStrClient(Client, "CAP %s NAK :%s",
Client_ID(Client), Arg);
}
return CONNECTED;
}
+/**
+ * Set CAP negotiation status and mark client as "supports capabilities".
+ *
+ * @param Client The client to handle.
+ */
+void
+Set_CAP_Negotiation(CLIENT *Client)
+{
+ assert(Client != NULL);
+
+ if (Client_Type(Client) != CLIENT_USER)
+ Client_CapAdd(Client, CLIENT_CAP_PENDING);
+ Client_CapAdd(Client, CLIENT_CAP_SUPPORTED);
+}
+
/* -eof- */