ViewVC Help
View File | Revision Log | Show Annotations | View Changeset | Root Listing
root/svn/ircd-hybrid/trunk/modules/m_wallops.c
Revision: 2038
Committed: Tue May 14 19:21:32 2013 UTC (13 years, 5 months ago) by michael
Content type: text/x-csrc
File size: 3208 byte(s)
Log Message:
- Added 'locops' and 'wallops' to irc-operator flags
--- Diese und die folgenden Zeilen werden ignoriert --

M    include/client.h
M    src/conf_parser.c
M    src/conf_parser.h
M    src/conf_lexer.c
M    src/conf_parser.y
M    src/conf_lexer.l
M    doc/reference.conf
M    modules/m_locops.c
M    modules/m_wallops.c

File Contents

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

Properties

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