1 /* {{{ irc-seven: Cows like it.
3 * Copyright (C) 1990 Jarkko Oikarinen and University of Oulu, Co Center
4 * Copyright (C) 1996-2002 Hybrid Development Team
5 * Copyright (C) 2002-2005 ircd-ratbox development team
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.
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.
17 * You should have received a copy of the GNU General Public License
18 * along with this program; if not, write to:
20 * Free Software Foundation, Inc.
21 * 51 Franklin St - Fifth Floor
22 * Boston, MA 02110-1301
41 static int m_error (struct Client
*, struct Client
*, int, const char **);
42 static int ms_error (struct Client
*, struct Client
*, int, const char **);
44 /* {{{ struct Message error_msgtab = { ... }
46 * This message handler table is referenced in src/module.c and used by
47 * support code for the vaious MOD* commands and therefore cannot be
50 struct Message error_msgtab
=
52 "ERROR", 0, 0, 0, MFLG_SLOW
| MFLG_UNREG
,
54 {m_error
, 0}, mg_ignore
, mg_ignore
,
55 {ms_error
, 0}, mg_ignore
, mg_ignore
,
60 mapi_clist_av1 error_clist
[] =
66 /* {{{ DECLARE_MODULE_AV1(...) */
84 * Note: At least at protocol level ERROR has only one parameter,
85 * although this is called internally from other functions
92 m_error (struct Client
*client_p
, struct Client
*source_p
, int parc
, const char **parv
)
94 const char *para
= "<>";
96 if (parc
> 1 && !EmptyString(parv
[1]))
99 ilog(L_SERVER
, "Received ERROR message from %s: %s",
100 log_client_name(source_p
, SHOW_IP
), para
);
102 if (IsAnyServer(client_p
) && ConfigFileEntry
.hide_error_messages
< 2)
104 sendto_realops_snomask(SNO_GENERAL
, L_ADMIN
,
105 "ERROR :from %s -- %s",
106 get_server_name(client_p
, HIDE_IP
), para
);
108 if (!ConfigFileEntry
.hide_error_messages
)
109 sendto_realops_snomask(SNO_GENERAL
, L_OPER
,
110 "ERROR :from %s -- %s",
111 get_server_name(client_p
, HIDE_IP
), para
);
114 exit_client(client_p
, source_p
, source_p
, "ERROR");
128 ms_error(struct Client
*client_p
, struct Client
*source_p
, int parc
, const char *parv
[])
130 const char *para
= "<>";
132 if (parc
> 1 && !EmptyString(parv
[1]))
135 ilog(L_SERVER
, "Received ERROR message from %s: %s",
136 log_client_name(source_p
, SHOW_IP
), para
);
138 if(ConfigFileEntry
.hide_error_messages
== 2)
141 if(client_p
== source_p
)
143 sendto_realops_snomask(SNO_GENERAL
, L_ADMIN
,
144 "ERROR :from %s -- %s",
145 get_server_name(client_p
, HIDE_IP
), para
);
147 if(!ConfigFileEntry
.hide_error_messages
)
148 sendto_realops_snomask(SNO_GENERAL
, L_OPER
,
149 "ERROR :from %s -- %s",
150 get_server_name(client_p
, HIDE_IP
), para
);
154 sendto_realops_snomask(SNO_GENERAL
, L_ADMIN
,
155 "ERROR :from %s via %s -- %s", source_p
->name
,
156 get_server_name(client_p
, HIDE_IP
), para
);
158 if(!ConfigFileEntry
.hide_error_messages
)
159 sendto_realops_snomask(SNO_GENERAL
, L_OPER
,
160 "ERROR :from %s via %s -- %s",
162 get_server_name(client_p
, HIDE_IP
), para
);
170 * vim: ts=8 sw=8 noet fdm=marker tw=80