if (client == cl)
return 0; // FIXME: error message
killConnection(cl, false);
+ } else if(strcmp(command, "WALLOPS") == 0) {
+ if (!is_registered(client))
+ return err_notregistered(client), sendbuf(client), 0;
+ if (argc < 1)
+ return err_needmoreparams(client, command), 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;
+ }
+ msg_wallops(client, args[0]);
+ struct trie_find *f = NULL;
+ if (trie_findfirst(&f, &client_map) == 1)
+ do {
+ struct client_data *cl = f->n->value;
+ if (cl->umode & UMODE_WALLOPS)
+ sendbuf(cl);
+ } while (trie_findnext(&f) == 1);
} else if(strcmp(command, "KILL") == 0) {
if (!is_registered(client))
return err_notregistered(client), sendbuf(client), 0;
copy_strf(&databuf, ":%s!%s@%s KILL %s :%s\r\n",
src->nick, src->username, src->hostname, dst->nick, reason);
}
-#if 0
void msg_wallops(struct client_data *src, const char *msg)
{
copy_strf(&databuf, ":%s!%s@%s WALLOPS :%s\r\n",
src->nick, src->username, src->hostname, msg);
}
-#endif
void rpl_welcome(struct client_data *client) // 001
{
copy_strf(&databuf, ":%s 001 %s :Welcome to the Patchy Network, %s\r\n", hostname, client->nick, client->nick);