ViewVC Help
View File | Revision Log | Show Annotations | View Changeset | Root Listing
root/svn/ircd-hybrid/modules/m_operwall.c
Revision: 405
Committed: Tue Feb 7 19:38:35 2006 UTC (20 years, 6 months ago) by michael
Content type: text/x-csrc
File size: 3660 byte(s)
Log Message:
- Removed now unused llflags parameter from sendto_server()


File Contents

# User Rev Content
1 adx 30 /*
2     * ircd-hybrid: an advanced Internet Relay Chat Daemon(ircd).
3     * m_operwall.c: Sends a message to all IRCOps.
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 "handlers.h"
27     #include "client.h"
28     #include "ircd.h"
29     #include "numeric.h"
30     #include "send.h"
31     #include "s_user.h"
32     #include "msg.h"
33     #include "parse.h"
34     #include "modules.h"
35     #include "s_serv.h"
36    
37 michael 405 static void mo_operwall(struct Client *, struct Client *, int, char *[]);
38     static void ms_operwall(struct Client *, struct Client *, int, char *[]);
39     static void me_operwall(struct Client *, struct Client *, int, char *[]);
40 adx 30
41     struct Message operwall_msgtab = {
42     "OPERWALL", 0, 0, 2, 0, MFLG_SLOW, 0,
43 michael 405 { m_unregistered, m_not_oper, ms_operwall, me_operwall, mo_operwall, m_ignore }
44 adx 30 };
45    
46     #ifndef STATIC_MODULES
47     void
48     _modinit(void)
49     {
50     mod_add_cmd(&operwall_msgtab);
51     }
52    
53     void
54     _moddeinit(void)
55     {
56     mod_del_cmd(&operwall_msgtab);
57     }
58    
59 knight 31 const char *_version = "$Revision$";
60 adx 30 #endif
61    
62    
63     /*
64     * mo_operwall - OPERWALL message handler
65     * (write to *all* local opers currently online)
66     * parv[0] = sender prefix
67     * parv[1] = message text
68     */
69     static void
70     mo_operwall(struct Client *client_p, struct Client *source_p,
71     int parc, char *parv[])
72     {
73     const char *message = parv[1];
74    
75     if (!IsOperWall(source_p))
76     {
77     sendto_one(source_p, form_str(ERR_NOPRIVS),
78     me.name, source_p->name, "operwall");
79     return;
80     }
81    
82     if (EmptyString(message))
83     {
84     sendto_one(source_p, form_str(ERR_NEEDMOREPARAMS),
85     me.name, source_p->name, "OPERWALL");
86     return;
87     }
88    
89 michael 405 sendto_server(NULL, source_p, NULL, CAP_TS6, NOCAPS,
90 adx 30 ":%s OPERWALL :%s", ID(source_p), message);
91 michael 405 sendto_server(NULL, source_p, NULL, NOCAPS, CAP_TS6,
92 adx 30 ":%s OPERWALL :%s", source_p->name, message);
93     sendto_wallops_flags(UMODE_OPERWALL, source_p, "OPERWALL - %s", message);
94     }
95    
96     /*
97     * ms_operwall - OPERWALL message handler
98     * (write to *all* local opers currently online)
99     * parv[0] = sender prefix
100     * parv[1] = message text
101     */
102     static void
103     ms_operwall(struct Client *client_p, struct Client *source_p,
104     int parc, char *parv[])
105     {
106     const char *message = parv[1];
107    
108     if (EmptyString(message))
109     return;
110    
111 michael 405 sendto_server(client_p, source_p, NULL, NOCAPS, NOCAPS,
112 adx 30 ":%s OPERWALL :%s", parv[0], message);
113     sendto_wallops_flags(UMODE_OPERWALL, source_p, "OPERWALL - %s", message);
114     }
115    
116     /*
117     * me_operwall - OPERWALL message handler
118     * (write to *all* local opers currently online)
119     * parv[0] = sender prefix
120     * parv[1] = message text
121     *
122     * Lets ms_encap handle propagation.
123     */
124     static void
125     me_operwall(struct Client *client_p, struct Client *source_p,
126     int parc, char *parv[])
127     {
128     const char *message = parv[1];
129    
130     if (EmptyString(message))
131     return;
132    
133     sendto_wallops_flags(UMODE_OPERWALL, source_p, "OPERWALL - %s", message);
134     }

Properties

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