case 'b':
case 'e':
case 'I':
+ break;
+ case 'v':
+ case 'o':
+ if(!*argp)
+ continue;
+ const char *nick = *argp++;
+ char which[2] = {*p, 0};
+ struct client_data *cl = findClient(nick);
+ if (!cl) {
+ err_nosuchnick(client, nick), sendbuf(client);
+ continue;
+ }
+ if (!trie_get(&chan->members, cl->key)) {
+ err_usernotinchannel(client, cl->nick, chan), sendbuf(client);
+ continue;
+ }
+ trie_set(*p == 'o' ? &chan->o : &chan->v, cl->key, is_plus ? cl : NULL, NULL);
+ copy_strf(&databuf, ":%s!%s@%s MODE %s %s%s %s\r\n",
+ client->nick, client->username, client->hostname,
+ chan->name, is_plus?"+":"-", which, cl->nick);
+ sendbuf_chan(chan);
+ break;
default:
goto unknown;
}
{
copy_strf(&databuf, ":%s 433 %s %s :Nickname is already in use\r\n", hostname, client->nick, nick);
}
-#if 0
void err_usernotinchannel(struct client_data *client, const char *nick, struct channel *chan) // 441
{
copy_strf(&databuf, ":%s 441 %s %s %s :They aren't on that channel\r\n", hostname, client->nick, nick, chan->name);
}
+#if 0
void err_notonchannel(struct client_data *client, struct channel *chan) // 442
{
copy_strf(&databuf, ":%s 442 %s %s :is already on channel\r\n", hostname, client->nick, chan->name);