]> jfr.im git - irc/rqf/shadowircd.git/blame - extensions/createauthonly.c
Disallow mIRC italics in channel names when disable_fake_channels
[irc/rqf/shadowircd.git] / extensions / createauthonly.c
CommitLineData
212380e3 1/*
2 * This module restricts channel creation to authenticated users
b47db00e
JT
3 * and IRC operators only. This module could be useful for
4 * running private chat systems, or if a network gets droneflood
5 * problems. It will return ERR_NEEDREGGEDNICK on failure.
212380e3 6 * -- nenolod
7 *
212380e3 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(createauthonly, NULL, NULL, NULL, NULL, restrict_hfnlist, "$Revision: 833 $");
28
29static void
30h_can_create_channel_authenticated(hook_data_client_approval *data)
31{
32 struct Client *source_p = data->client;
33
b47db00e 34 if (*source_p->user->suser == '\0' && !IsOper(source_p))
212380e3 35 data->approved = ERR_NEEDREGGEDNICK;
36}