if (client == cl)
return 0; // FIXME: error message
killConnection(cl, false);
+ } else if(strcmp(command, "KILL") == 0) {
+ if (!is_registered(client))
+ return err_notregistered(client), sendbuf(client), 0;
+ if (!(client->umode & UMODE_OPER)) {
+ copy_strf(&databuf, ":%s 481 %s :Permission Denied- You're not an IRC operator\r\n", hostname, client->nick);
+ sendbuf(client);
+ return 0;
+ }
+ if (argc < 1)
+ return err_needmoreparams(client, command), sendbuf(client), 0;
+ struct client_data *cl = findClient(args[0]);
+ if (!cl)
+ return 0; // FIXME: error message
+ if (client == cl)
+ return 0; // FIXME: error message
+ msg_kill(client, cl, args[1] ? args[1] : "(no reason)");
+ struct trie_find *f = NULL;
+ if (trie_findfirst(&f, &client_map) == 1)
+ do {
+ struct client_data *cl2 = f->n->value;
+ if (cl2->umode & UMODE_OPER)
+ sendbuf(cl2);
+ } while (trie_findnext(&f) == 1);
+ // FIXME: add appropraite QUIT message
+ killConnection(cl, false);
} else if(strcmp(command, "JEDGAR") == 0) {
if (!is_registered(client))
return err_notregistered(client), sendbuf(client), 0;