- if (Client_Type(Client) != CLIENT_USER)
- Client_CapAdd(Client, CLIENT_CAP_PENDING);
- Client_CapAdd(Client, CLIENT_CAP_SUPPORTED);
+ LogDebug("Got \"%s %s\" command from \"%s\" ...",
+ Req->command, Req->argv[0], Client_ID(Client));
+
+ if (Req->argc == 1) {
+ if (strcasecmp(Req->argv[0], "CLEAR") == 0)
+ return Handle_CAP_CLEAR(Client);
+ if (strcasecmp(Req->argv[0], "END") == 0)
+ return Handle_CAP_END(Client);
+ }
+ if (Req->argc >= 1 && Req->argc <= 2) {
+ if (strcasecmp(Req->argv[0], "LS") == 0)
+ return Handle_CAP_LS(Client, Req->argv[1]);
+ if (strcasecmp(Req->argv[0], "LIST") == 0)
+ return Handle_CAP_LIST(Client, Req->argv[1]);
+ }
+ if (Req->argc == 2) {
+ if (strcasecmp(Req->argv[0], "REQ") == 0)
+ return Handle_CAP_REQ(Client, Req->argv[1]);
+ if (strcasecmp(Req->argv[0], "ACK") == 0)
+ return Handle_CAP_ACK(Client, Req->argv[1]);
+ }
+
+ return IRC_WriteErrClient(Client, ERR_INVALIDCAP_MSG,
+ Client_ID(Client), Req->argv[0]);