]> jfr.im git - irc/rqf/shadowircd.git/blame - extensions/createoperonly.c
ShadowIRCd 6.2.0-beta1
[irc/rqf/shadowircd.git] / extensions / createoperonly.c
CommitLineData
45ed9777 1/*
2 * This module restricts channel creation to opered up users
3 * only. This module could be useful for running private chat
4 * systems, or if a network gets droneflood problems. It will
5 * return ERR_NEEDREGGEDNICK on failure.
6 * -- nenolod
7 *
45ed9777 8 */
9
10#include "stdinc.h"
11#include "modules.h"
12#include "client.h"
13#include "hook.h"
14#include "ircd.h"
15#include "send.h"
16#include "s_conf.h"
17#include "snomask.h"
18#include "numeric.h"
19
20static void h_can_create_channel_authenticated(hook_data_client_approval *);
21
22mapi_hfn_list_av1 restrict_hfnlist[] = {
23 { "can_create_channel", (hookfn) h_can_create_channel_authenticated },
24 { NULL, NULL }
25};
26
27DECLARE_MODULE_AV1(createoperonly, NULL, NULL, NULL, NULL, restrict_hfnlist, "$Revision: 3476 $");
28
29static void
30h_can_create_channel_authenticated(hook_data_client_approval *data)
31{
32 struct Client *source_p = data->client;
33
34 if (!IsOper(source_p))
35 {
36 sendto_one_notice(source_p, ":*** Channel creation is restricted to network staff only.");
37 data->approved = ERR_NEEDREGGEDNICK;
38 }
39}