]> jfr.im git - solanum.git/blame - extensions/createauthonly.c
Bye m_42.
[solanum.git] / extensions / createauthonly.c
CommitLineData
212380e3
AC
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
212380e3
AC
7 */
8
9#include "stdinc.h"
10#include "modules.h"
11#include "client.h"
12#include "hook.h"
13#include "ircd.h"
14#include "send.h"
15#include "s_conf.h"
16#include "snomask.h"
17#include "numeric.h"
18
19static void h_can_create_channel_authenticated(hook_data_client_approval *);
20
21mapi_hfn_list_av1 restrict_hfnlist[] = {
22 { "can_create_channel", (hookfn) h_can_create_channel_authenticated },
23 { NULL, NULL }
24};
25
04f832b7 26DECLARE_MODULE_AV2(createauthonly, NULL, NULL, NULL, NULL, restrict_hfnlist, NULL, NULL, NULL);
212380e3
AC
27
28static void
29h_can_create_channel_authenticated(hook_data_client_approval *data)
30{
31 struct Client *source_p = data->client;
32
b47db00e 33 if (*source_p->user->suser == '\0' && !IsOper(source_p))
212380e3
AC
34 data->approved = ERR_NEEDREGGEDNICK;
35}