1 |
adx |
30 |
/* |
2 |
michael |
2821 |
* ircd-hybrid: an advanced, lightweight Internet Relay Chat Daemon (ircd) |
3 |
adx |
30 |
* |
4 |
michael |
2821 |
* Copyright (c) 1997-2014 ircd-hybrid development team |
5 |
adx |
30 |
* |
6 |
|
|
* This program is free software; you can redistribute it and/or modify |
7 |
|
|
* it under the terms of the GNU General Public License as published by |
8 |
|
|
* the Free Software Foundation; either version 2 of the License, or |
9 |
|
|
* (at your option) any later version. |
10 |
|
|
* |
11 |
|
|
* This program is distributed in the hope that it will be useful, |
12 |
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
13 |
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
14 |
|
|
* GNU General Public License for more details. |
15 |
|
|
* |
16 |
|
|
* You should have received a copy of the GNU General Public License |
17 |
|
|
* along with this program; if not, write to the Free Software |
18 |
|
|
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 |
19 |
|
|
* USA |
20 |
|
|
*/ |
21 |
|
|
|
22 |
michael |
2821 |
/*! \file m_operwall.c |
23 |
|
|
* \brief Includes required functions for processing the OPERWALL command. |
24 |
|
|
* \version $Id$ |
25 |
|
|
*/ |
26 |
|
|
|
27 |
adx |
30 |
#include "stdinc.h" |
28 |
|
|
#include "client.h" |
29 |
|
|
#include "ircd.h" |
30 |
|
|
#include "irc_string.h" |
31 |
|
|
#include "numeric.h" |
32 |
|
|
#include "send.h" |
33 |
|
|
#include "s_user.h" |
34 |
|
|
#include "parse.h" |
35 |
|
|
#include "modules.h" |
36 |
|
|
#include "s_serv.h" |
37 |
|
|
|
38 |
|
|
|
39 |
|
|
/* |
40 |
|
|
* mo_operwall - OPERWALL message handler |
41 |
|
|
* (write to *all* local opers currently online) |
42 |
|
|
* parv[0] = sender prefix |
43 |
|
|
* parv[1] = message text |
44 |
|
|
*/ |
45 |
michael |
2821 |
static int |
46 |
adx |
30 |
mo_operwall(struct Client *client_p, struct Client *source_p, |
47 |
|
|
int parc, char *parv[]) |
48 |
|
|
{ |
49 |
|
|
const char *message = parv[1]; |
50 |
|
|
|
51 |
michael |
1219 |
if (!HasOFlag(source_p, OPER_FLAG_OPERWALL)) |
52 |
adx |
30 |
{ |
53 |
michael |
1834 |
sendto_one(source_p, form_str(ERR_NOPRIVS), |
54 |
adx |
30 |
me.name, source_p->name, "operwall"); |
55 |
michael |
2821 |
return 0; |
56 |
adx |
30 |
} |
57 |
|
|
|
58 |
|
|
if (EmptyString(message)) |
59 |
|
|
{ |
60 |
michael |
1834 |
sendto_one(source_p, form_str(ERR_NEEDMOREPARAMS), |
61 |
adx |
30 |
me.name, source_p->name, "OPERWALL"); |
62 |
michael |
2821 |
return 0; |
63 |
adx |
30 |
} |
64 |
|
|
|
65 |
michael |
2821 |
sendto_server(NULL, CAP_TS6, NOCAPS, ":%s OPERWALL :%s", |
66 |
|
|
ID(source_p), message); |
67 |
|
|
sendto_server(NULL, NOCAPS, CAP_TS6, ":%s OPERWALL :%s", |
68 |
|
|
source_p->name, message); |
69 |
adx |
30 |
sendto_wallops_flags(UMODE_OPERWALL, source_p, "OPERWALL - %s", message); |
70 |
michael |
2821 |
return 0; |
71 |
adx |
30 |
} |
72 |
|
|
|
73 |
|
|
/* |
74 |
|
|
* ms_operwall - OPERWALL message handler |
75 |
|
|
* (write to *all* local opers currently online) |
76 |
|
|
* parv[0] = sender prefix |
77 |
|
|
* parv[1] = message text |
78 |
|
|
*/ |
79 |
michael |
2821 |
static int |
80 |
adx |
30 |
ms_operwall(struct Client *client_p, struct Client *source_p, |
81 |
|
|
int parc, char *parv[]) |
82 |
|
|
{ |
83 |
|
|
const char *message = parv[1]; |
84 |
|
|
|
85 |
|
|
if (EmptyString(message)) |
86 |
michael |
2821 |
return 0; |
87 |
adx |
30 |
|
88 |
michael |
1474 |
sendto_server(client_p, CAP_TS6, NOCAPS, ":%s OPERWALL :%s", |
89 |
michael |
1040 |
ID(source_p), message); |
90 |
michael |
1474 |
sendto_server(client_p, NOCAPS, CAP_TS6, ":%s OPERWALL :%s", |
91 |
michael |
885 |
source_p->name, message); |
92 |
adx |
30 |
sendto_wallops_flags(UMODE_OPERWALL, source_p, "OPERWALL - %s", message); |
93 |
michael |
2821 |
return 0; |
94 |
adx |
30 |
} |
95 |
|
|
|
96 |
michael |
2821 |
static struct Message operwall_msgtab = |
97 |
|
|
{ |
98 |
michael |
1230 |
"OPERWALL", 0, 0, 2, MAXPARA, MFLG_SLOW, 0, |
99 |
michael |
2823 |
{ m_unregistered, m_not_oper, ms_operwall, m_ignore, mo_operwall, m_ignore } |
100 |
michael |
1230 |
}; |
101 |
|
|
|
102 |
|
|
static void |
103 |
|
|
module_init(void) |
104 |
|
|
{ |
105 |
|
|
mod_add_cmd(&operwall_msgtab); |
106 |
|
|
} |
107 |
|
|
|
108 |
|
|
static void |
109 |
|
|
module_exit(void) |
110 |
|
|
{ |
111 |
|
|
mod_del_cmd(&operwall_msgtab); |
112 |
|
|
} |
113 |
|
|
|
114 |
michael |
2821 |
struct module module_entry = |
115 |
|
|
{ |
116 |
michael |
1230 |
.node = { NULL, NULL, NULL }, |
117 |
|
|
.name = NULL, |
118 |
|
|
.version = "$Revision$", |
119 |
|
|
.handle = NULL, |
120 |
|
|
.modinit = module_init, |
121 |
|
|
.modexit = module_exit, |
122 |
|
|
.flags = 0 |
123 |
|
|
}; |