ViewVC Help
View File | Revision Log | Show Annotations | View Changeset | Root Listing
root/svn/ircd-hybrid/trunk/modules/m_operwall.c
Revision: 2822
Committed: Wed Jan 15 23:17:03 2014 UTC (12 years, 6 months ago) by michael
Content type: text/x-csrc
File size: 3282 byte(s)
Log Message:
- m_operwall.c: removed me_operwall() encap handler

File Contents

# Content
1 /*
2 * ircd-hybrid: an advanced, lightweight Internet Relay Chat Daemon (ircd)
3 *
4 * Copyright (c) 1997-2014 ircd-hybrid development team
5 *
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 /*! \file m_operwall.c
23 * \brief Includes required functions for processing the OPERWALL command.
24 * \version $Id$
25 */
26
27 #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 static int
46 mo_operwall(struct Client *client_p, struct Client *source_p,
47 int parc, char *parv[])
48 {
49 const char *message = parv[1];
50
51 if (!HasOFlag(source_p, OPER_FLAG_OPERWALL))
52 {
53 sendto_one(source_p, form_str(ERR_NOPRIVS),
54 me.name, source_p->name, "operwall");
55 return 0;
56 }
57
58 if (EmptyString(message))
59 {
60 sendto_one(source_p, form_str(ERR_NEEDMOREPARAMS),
61 me.name, source_p->name, "OPERWALL");
62 return 0;
63 }
64
65 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 sendto_wallops_flags(UMODE_OPERWALL, source_p, "OPERWALL - %s", message);
70 return 0;
71 }
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 static int
80 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 return 0;
87
88 sendto_server(client_p, CAP_TS6, NOCAPS, ":%s OPERWALL :%s",
89 ID(source_p), message);
90 sendto_server(client_p, NOCAPS, CAP_TS6, ":%s OPERWALL :%s",
91 source_p->name, message);
92 sendto_wallops_flags(UMODE_OPERWALL, source_p, "OPERWALL - %s", message);
93 return 0;
94 }
95
96 static struct Message operwall_msgtab =
97 {
98 "OPERWALL", 0, 0, 2, MAXPARA, MFLG_SLOW, 0,
99 { m_unregistered, m_not_oper, ms_operwall, m_ignore, mo_operwall, m_ignore }
100 };
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 struct module module_entry =
115 {
116 .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 };

Properties

Name Value
svn:eol-style native
svn:keywords Id Revision