From 5366977b4f3c7a50d170bf7a1e29b14c74944db7 Mon Sep 17 00:00:00 2001 From: nenolod Date: Wed, 24 Jan 2007 23:23:01 -0800 Subject: [PATCH] [svn] Backport from early 3.x: -- nenolod 2006/09/27 16:39:14 UTC (20060927-2178) Log: - remove "Processing connection to foobar.net" message Changes: Modified: +0 -3 trunk/src/s_auth.c (File Modified) nenolod 2006/09/27 16:34:26 UTC (20060927-2176) Log: - missed the processing connection one (actually, we can probably nuke this one) Changes: Modified: +1 -2 trunk/src/s_auth.c (File Modified) river 2006/09/27 16:33:05 UTC (20060927-2174) Log: get_client_name = stupid Changes: Modified: +10 -7 trunk/modules/core/m_kill.c (File Modified) nenolod 2006/09/27 16:32:37 UTC (20060927-2172) Log: - remove excessive arguments Changes: Modified: +1 -2 trunk/src/s_conf.c (File Modified) +1 -1 trunk/src/s_user.c (File Modified) nenolod 2006/09/27 16:30:59 UTC (20060927-2170) Log: - use sendto_one_notice() for on-connect notices too. Changes: Modified: +10 -10 trunk/src/s_auth.c (File Modified) nenolod 2006/09/27 16:27:01 UTC (20060927-2168) Log: - use sendto_one_notice() in the core, too. Changes: Modified: +2 -2 trunk/src/chmode.c (File Modified) +8 -15 trunk/src/modules.c (File Modified) +3 -5 trunk/src/s_conf.c (File Modified) +1 -2 trunk/src/s_newconf.c (File Modified) +20 -57 trunk/src/s_user.c (File Modified) river 2006/09/27 16:19:25 UTC (20060927-2166) Log: the KILL command will use get_client_name(, SHOW_IP) instead of target->name, and will show a more useful error for local opers Changes: Modified: +6 -4 trunk/modules/core/m_kill.c (File Modified) nenolod 2006/09/27 16:09:48 UTC (20060927-2164) Log: - fix bugs in sendto_one_notice()/sendto_one_numeric() where a client identifier won't be sent to unregistered clients Changes: Modified: +4 -2 trunk/src/send.c (File Modified) nenolod 2006/09/27 16:05:46 UTC (20060927-2161) Log: - back out r2159 Changes: Modified: +1 -1 trunk/include/client.h (File Modified) nenolod 2006/09/27 16:04:05 UTC (20060927-2159) Log: - get_id(): fall back to "*" if client has no known name Changes: Modified: +1 -1 trunk/include/client.h (File Modified) nenolod 2006/09/27 16:01:29 UTC (20060927-2157) Log: - convert to sendto_one_notice(). Changes: Modified: +2 -3 trunk/unsupported/m_clearchan.c (File Modified) +4 -6 trunk/unsupported/m_force.c (File Modified) nenolod 2006/09/27 15:57:11 UTC (20060927-2155) Log: - use sendto_one_notice() in many places instead of sendto_one(source_p, ":%s NOTICE %s :", ...); Changes: Modified: +10 -25 trunk/extensions/example_module.c (File Modified) +5 -14 trunk/extensions/hurt.c (File Modified) +1 -2 trunk/extensions/m_42.c (File Modified) +7 -12 trunk/extensions/m_mkpasswd.c (File Modified) +1 -2 trunk/extensions/m_ojoin.c (File Modified) +1 -2 trunk/extensions/m_opme.c (File Modified) +3 -3 trunk/extensions/spy_whois_notice.c (File Modified) +3 -3 trunk/extensions/spy_whois_notice_global.c (File Modified) +3 -7 trunk/modules/core/m_die.c (File Modified) +2 -4 trunk/modules/core/m_kill.c (File Modified) +2 -2 trunk/modules/core/m_squit.c (File Modified) +1 -2 trunk/modules/m_challenge.c (File Modified) +11 -15 trunk/modules/m_connect.c (File Modified) +20 -28 trunk/modules/m_dline.c (File Modified) +2 -2 trunk/modules/m_etrace.c (File Modified) +11 -21 trunk/modules/m_gline.c (File Modified) +2 -4 trunk/modules/m_kline.c (File Modified) +1 -2 trunk/modules/m_rehash.c (File Modified) +3 -7 trunk/modules/m_restart.c (File Modified) +31 -45 trunk/modules/m_set.c (File Modified) +2 -4 trunk/modules/m_testmask.c (File Modified) +5 -8 trunk/modules/m_unreject.c (File Modified) +2 -5 trunk/modules/m_xline.c (File Modified) -- --- ChangeLog | 15 ++++++ doc/sgml/oper-guide/commands.sgml | 2 + extensions/example_module.c | 39 +++++--------- extensions/hurt.c | 23 +++----- extensions/m_42.c | 5 +- extensions/m_mkpasswd.c | 23 ++++---- extensions/m_ojoin.c | 7 ++- extensions/m_opme.c | 7 ++- extensions/spy_whois_notice.c | 10 ++-- extensions/spy_whois_notice_global.c | 10 ++-- include/serno.h | 2 +- modules/core/m_die.c | 14 ++--- modules/core/m_kill.c | 29 +++++----- modules/core/m_squit.c | 8 +-- modules/m_challenge.c | 9 ++-- modules/m_connect.c | 30 +++++------ modules/m_dline.c | 10 ++-- modules/m_etrace.c | 8 +-- modules/m_gline.c | 36 +++++-------- modules/m_kline.c | 10 ++-- modules/m_rehash.c | 7 ++- modules/m_restart.c | 14 ++--- modules/m_set.c | 80 ++++++++++++---------------- modules/m_testmask.c | 10 ++-- modules/m_unreject.c | 17 +++--- modules/m_xline.c | 8 ++- src/chmode.c | 6 +-- src/modules.c | 25 ++++----- src/s_auth.c | 26 ++++----- src/s_conf.c | 11 ++-- src/s_newconf.c | 5 +- src/s_user.c | 79 ++++++++------------------- src/send.c | 8 +-- unsupported/m_clearchan.c | 9 ++-- unsupported/m_force.c | 14 +++-- 35 files changed, 251 insertions(+), 365 deletions(-) diff --git a/ChangeLog b/ChangeLog index a950e7e..332cfea 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,18 @@ +nenolod 2007/01/25 07:08:21 UTC (20070125-3159) + Log: + - keyword-subst from charybdis 2.2. + + + Changes: Modified: + +12 -3 trunk/doc/example.conf (File Modified) + +58 -3 trunk/doc/reference.conf (File Modified) + + - trunk/include/substitution.h (File Added) + +1 -0 trunk/src/Makefile.in (File Modified) + +2 -2 trunk/src/s_conf.c (File Modified) + +164 -1 trunk/src/s_user.c (File Modified) + + - trunk/src/substitution.c (File Added) + + nenolod 2007/01/25 07:00:49 UTC (20070125-3157) Log: Removed merge tracking for "svnmerge" for diff --git a/doc/sgml/oper-guide/commands.sgml b/doc/sgml/oper-guide/commands.sgml index 25726e2..52e0517 100644 --- a/doc/sgml/oper-guide/commands.sgml +++ b/doc/sgml/oper-guide/commands.sgml @@ -417,6 +417,8 @@ Adds a D:line to dline.conf, which will deny any connections from the given IP address. + The IP address can be given as a full address (192.168.0.1) or + as a CIDR mask (192.168.0.0/24). If the optional parameter length is given, the D:line will diff --git a/extensions/example_module.c b/extensions/example_module.c index 32e1509..526fba3 100644 --- a/extensions/example_module.c +++ b/extensions/example_module.c @@ -16,7 +16,7 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. * - * $Id: example_module.c 494 2006-01-15 16:08:28Z jilles $ + * $Id: example_module.c 3161 2007-01-25 07:23:01Z nenolod $ */ /* List of ircd includes from ../include/ */ @@ -144,7 +144,7 @@ DECLARE_MODULE_AV1( /* Then the hook function list, if we have one */ test_hfnlist, /* And finally the version number of this module. */ - "$Revision: 494 $"); + "$Revision: 3161 $"); /* Any of the above arguments can be NULL to indicate they aren't used. */ @@ -163,13 +163,11 @@ munreg_test(struct Client *client_p, struct Client *source_p, int parc, const ch { if(parc < 2) { - sendto_one(source_p, ":%s NOTICE %s :You are unregistered and sent no parameters", - me.name, source_p->name); + sendto_one_notice(source_p, ":You are unregistered and sent no parameters"); } else { - sendto_one(source_p, ":%s NOTICE %s :You are unregistered and sent parameter: %s", - me.name, source_p->name, parv[1]); + sendto_one_notice(source_p, ":You are unregistered and sent parameter: %s", parv[1]); } /* illustration of how to call a hook function */ @@ -188,14 +186,11 @@ mclient_test(struct Client *client_p, struct Client *source_p, int parc, const c { if(parc < 2) { - sendto_one(source_p, ":%s NOTICE %s :You are a normal user, and sent no parameters", - me.name, source_p->name); + sendto_one_notice(source_p, ":You are a normal user, and sent no parameters"); } else { - sendto_one(source_p, - ":%s NOTICE %s :You are a normal user, and send parameters: %s", me.name, - source_p->name, parv[1]); + sendto_one_notice(source_p, ":You are a normal user, and send parameters: %s", parv[1]); } /* illustration of how to call a hook function */ @@ -214,15 +209,11 @@ mrclient_test(struct Client *client_p, struct Client *source_p, int parc, const { if(parc < 2) { - sendto_one(source_p, - ":%s NOTICE %s :You are a remote client, and sent no parameters", - me.name, source_p->name); + sendto_one_notice(source_p, ":You are a remote client, and sent no parameters"); } else { - sendto_one(source_p, - ":%s NOTICE %s :You are a remote client, and sent parameters: %s", - me.name, source_p->name, parv[1]); + sendto_one_notice(source_p, ":You are a remote client, and sent parameters: %s", parv[1]); } return 0; } @@ -237,15 +228,11 @@ mserver_test(struct Client *client_p, struct Client *source_p, int parc, const c { if(parc < 2) { - sendto_one(source_p, - ":%s NOTICE %s :You are a server, and sent no parameters", - me.name, source_p->name); + sendto_one_notice(source_p, ":You are a server, and sent no parameters"); } else { - sendto_one(source_p, - ":%s NOTICE %s :You are a server, and sent parameters: %s", - me.name, source_p->name, parv[1]); + sendto_one_notice(source_p, ":You are a server, and sent parameters: %s", parv[1]); } return 0; } @@ -260,13 +247,11 @@ moper_test(struct Client *client_p, struct Client *source_p, int parc, const cha { if(parc < 2) { - sendto_one(source_p, ":%s NOTICE %s :You are an operator, and sent no parameters", - me.name, source_p->name); + sendto_one_notice(source_p, ":You are an operator, and sent no parameters"); } else { - sendto_one(source_p, ":%s NOTICE %s :You are an operator, and sent parameters: %s", - me.name, source_p->name, parv[1]); + sendto_one_notice(source_p, ":You are an operator, and sent parameters: %s", parv[1]); } return 0; } diff --git a/extensions/hurt.c b/extensions/hurt.c index 0708fab..777523d 100644 --- a/extensions/hurt.c +++ b/extensions/hurt.c @@ -4,7 +4,7 @@ * Copyright (C) 2006 charybdis development team * All rights reserved * - * $Id: hurt.c 1905 2006-08-29 14:51:31Z jilles $ + * $Id: hurt.c 3161 2007-01-25 07:23:01Z nenolod $ */ #include "stdinc.h" #include "modules.h" @@ -115,7 +115,7 @@ DECLARE_MODULE_AV1( hurt_clist, NULL, hurt_hfnlist, - "$Revision: 1905 $" + "$Revision: 3161 $" ); /* }}} */ @@ -196,15 +196,11 @@ mo_hurt(struct Client *client_p, struct Client *source_p, if (!expire) expire_time = HURT_DEFAULT_EXPIRE; if (expire && (expire_time = valid_temp_time(expire)) < 1) { - sendto_one(source_p, - ":%s NOTICE %s :Permanent HURTs are not supported", - me.name, source_p->name); + sendto_one_notice(source_p, ":Permanent HURTs are not supported"); return 0; } if (EmptyString(reason)) { - sendto_one(source_p, - ":%s NOTICE %s :Empty HURT reasons are bad for business", - me.name, source_p->name); + sendto_one_notice(source_p, ":Empty HURT reasons are bad for business"); return 0; } @@ -233,9 +229,7 @@ mo_hurt(struct Client *client_p, struct Client *source_p, } if (hurt_find(ip) != NULL) { - sendto_one(source_p, - ":%s NOTICE %s :[%s] already HURT", - me.name, source_p->name, ip); + sendto_one(source_p, ":[%s] already HURT", ip); return 0; } @@ -334,8 +328,7 @@ mo_heal(struct Client *client_p, struct Client *source_p, { if (hurt_find_exact(parv[1]) == NULL) { - sendto_one(source_p, ":%s NOTICE %s :Mask [%s] is not HURT", - me.name, source_p->name, parv[1]); + sendto_one_notice(source_p, ":Mask [%s] is not HURT", parv[1]); return 0; } hurt_remove(parv[1]); @@ -346,9 +339,7 @@ mo_heal(struct Client *client_p, struct Client *source_p, } else { - sendto_one(source_p, - ":%s NOTICE %s :[%s] is not a valid IP address/nick", - me.name, source_p->name, parv[1]); + sendto_one(source_p, ":[%s] is not a valid IP address/nick", parv[1]); return 0; } diff --git a/extensions/m_42.c b/extensions/m_42.c index 1929478..805e122 100644 --- a/extensions/m_42.c +++ b/extensions/m_42.c @@ -2,7 +2,7 @@ * Copyright (C) infinity-infinity God * * Bob was here - * $Id: m_42.c 6 2005-09-10 01:02:21Z nenolod $ + * $Id: m_42.c 3161 2007-01-25 07:23:01Z nenolod $ */ #include "stdinc.h" @@ -28,8 +28,7 @@ DECLARE_MODULE_AV1(42, NULL, NULL, hgtg_clist, NULL, NULL, "Revision 0.42"); static int mclient_42(struct Client *client_p, struct Client *source_p, int parc, const char *parv[]) { - sendto_one(source_p, ":%s NOTICE %s :The Answer to Life, the Universe, and Everything.", - me.name, source_p->name); + sendto_one_notice(source_p, ":The Answer to Life, the Universe, and Everything."); return 0; } diff --git a/extensions/m_mkpasswd.c b/extensions/m_mkpasswd.c index 0d54494..b160c5f 100644 --- a/extensions/m_mkpasswd.c +++ b/extensions/m_mkpasswd.c @@ -6,7 +6,7 @@ * * You can use this code in any way as long as these names remain. * - * $Id: m_mkpasswd.c 6 2005-09-10 01:02:21Z nenolod $ + * $Id: m_mkpasswd.c 3161 2007-01-25 07:23:01Z nenolod $ */ /* List of ircd includes from ../include/ */ @@ -47,7 +47,7 @@ struct Message mkpasswd_msgtab = { mapi_clist_av1 mkpasswd_clist[] = { &mkpasswd_msgtab, NULL }; -DECLARE_MODULE_AV1(mkpasswd, NULL, NULL, mkpasswd_clist, NULL, NULL, "$Revision: 6 $"); +DECLARE_MODULE_AV1(mkpasswd, NULL, NULL, mkpasswd_clist, NULL, NULL, "$Revision: 3161 $"); static int @@ -82,9 +82,7 @@ m_mkpasswd(struct Client *client_p, struct Client *source_p, int parc, const cha } else { - sendto_one(source_p, - ":%s NOTICE %s :MKPASSWD syntax error: MKPASSWD pass [DES|MD5]", - me.name, parv[0]); + sendto_one_notice(source_p, ":MKPASSWD syntax error: MKPASSWD pass [DES|MD5]"); return 0; } } @@ -92,8 +90,8 @@ m_mkpasswd(struct Client *client_p, struct Client *source_p, int parc, const cha if(parc == 1) sendto_one(source_p, form_str(ERR_NEEDMOREPARAMS), me.name, parv[0], "MKPASSWD"); else - sendto_one(source_p, ":%s NOTICE %s :Encryption for [%s]: %s", - me.name, parv[0], parv[1], crypt(parv[1], + sendto_one_notice(source_p, ":Encryption for [%s]: %s", + parv[1], crypt(parv[1], is_md5 ? make_md5_salt() : make_salt())); @@ -125,9 +123,8 @@ mo_mkpasswd(struct Client *client_p, struct Client *source_p, int parc, const ch } else { - sendto_one(source_p, - ":%s NOTICE %s :MKPASSWD syntax error: MKPASSWD pass [DES|MD5]", - me.name, parv[0]); + sendto_one_notice(source_p, + ":MKPASSWD syntax error: MKPASSWD pass [DES|MD5]"); return 0; } } @@ -135,10 +132,8 @@ mo_mkpasswd(struct Client *client_p, struct Client *source_p, int parc, const ch if(parc == 1) sendto_one(source_p, form_str(ERR_NEEDMOREPARAMS), me.name, parv[0], "MKPASSWD"); else - sendto_one(source_p, ":%s NOTICE %s :Encryption for [%s]: %s", - me.name, parv[0], parv[1], crypt(parv[1], - is_md5 ? make_md5_salt() : - make_salt())); + sendto_one_notice(source_p, ":Encryption for [%s]: %s", + parv[1], crypt(parv[1], is_md5 ? make_md5_salt() : make_salt())); return 0; } diff --git a/extensions/m_ojoin.c b/extensions/m_ojoin.c index 0e401e3..3a769c2 100644 --- a/extensions/m_ojoin.c +++ b/extensions/m_ojoin.c @@ -16,7 +16,7 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. * - * $Id: m_ojoin.c 3121 2007-01-02 13:23:04Z jilles $ + * $Id: m_ojoin.c 3161 2007-01-25 07:23:01Z nenolod $ */ #include "stdinc.h" @@ -49,7 +49,7 @@ struct Message ojoin_msgtab = { mapi_clist_av1 ojoin_clist[] = { &ojoin_msgtab, NULL }; -DECLARE_MODULE_AV1(ojoin, NULL, NULL, ojoin_clist, NULL, NULL, "$Revision: 3121 $"); +DECLARE_MODULE_AV1(ojoin, NULL, NULL, ojoin_clist, NULL, NULL, "$Revision: 3161 $"); /* ** mo_ojoin @@ -84,8 +84,7 @@ mo_ojoin(struct Client *client_p, struct Client *source_p, int parc, const char if(IsMember(source_p, chptr)) { - sendto_one(source_p, ":%s NOTICE %s :Please part %s before using OJOIN", - me.name, source_p->name, parv[1]); + sendto_one_notice(source_p, ":Please part %s before using OJOIN", parv[1]); return 0; } diff --git a/extensions/m_opme.c b/extensions/m_opme.c index 9798b77..c9d88c0 100644 --- a/extensions/m_opme.c +++ b/extensions/m_opme.c @@ -16,7 +16,7 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. * - * $Id: m_opme.c 3121 2007-01-02 13:23:04Z jilles $ + * $Id: m_opme.c 3161 2007-01-25 07:23:01Z nenolod $ */ #include "stdinc.h" #include "tools.h" @@ -46,7 +46,7 @@ struct Message opme_msgtab = { mapi_clist_av1 opme_clist[] = { &opme_msgtab, NULL }; -DECLARE_MODULE_AV1(opme, NULL, NULL, opme_clist, NULL, NULL, "$Revision: 3121 $"); +DECLARE_MODULE_AV1(opme, NULL, NULL, opme_clist, NULL, NULL, "$Revision: 3161 $"); /* @@ -81,8 +81,7 @@ mo_opme(struct Client *client_p, struct Client *source_p, int parc, const char * if(is_chanop(msptr)) { - sendto_one(source_p, ":%s NOTICE %s :%s Channel is not opless", - me.name, parv[0], parv[1]); + sendto_one_notice(source_p, ":%s Channel is not opless", parv[1]); return 0; } } diff --git a/extensions/spy_whois_notice.c b/extensions/spy_whois_notice.c index ba29ef3..aa8e25b 100644 --- a/extensions/spy_whois_notice.c +++ b/extensions/spy_whois_notice.c @@ -19,7 +19,7 @@ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 * USA * - * $Id: spy_whois_notice.c 498 2006-01-15 16:40:33Z jilles $ + * $Id: spy_whois_notice.c 3161 2007-01-25 07:23:01Z nenolod $ */ #include "stdinc.h" #include "modules.h" @@ -35,7 +35,7 @@ mapi_hfn_list_av1 whois_hfnlist[] = { {NULL, NULL} }; -DECLARE_MODULE_AV1(whois_spy, NULL, NULL, NULL, NULL, whois_hfnlist, "$Revision: 498 $"); +DECLARE_MODULE_AV1(whois_spy, NULL, NULL, NULL, NULL, whois_hfnlist, "$Revision: 3161 $"); void show_whois(hook_data_client *data) @@ -47,9 +47,9 @@ show_whois(hook_data_client *data) if(MyClient(target_p) && IsOper(target_p) && (source_p != target_p) && (target_p->snomask & SNO_SPY)) { - sendto_one(target_p, - ":%s NOTICE %s :*** Notice -- %s (%s@%s) is doing a whois on you [%s]", - me.name, target_p->name, source_p->name, + sendto_one_notice(target_p, + ":*** Notice -- %s (%s@%s) is doing a whois on you [%s]", + source_p->name, source_p->username, source_p->host, source_p->user->server); } diff --git a/extensions/spy_whois_notice_global.c b/extensions/spy_whois_notice_global.c index b586d7e..0d16e3a 100644 --- a/extensions/spy_whois_notice_global.c +++ b/extensions/spy_whois_notice_global.c @@ -19,7 +19,7 @@ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 * USA * - * $Id: spy_whois_notice_global.c 498 2006-01-15 16:40:33Z jilles $ + * $Id: spy_whois_notice_global.c 3161 2007-01-25 07:23:01Z nenolod $ */ #include "stdinc.h" #include "modules.h" @@ -36,7 +36,7 @@ mapi_hfn_list_av1 whois_global_hfnlist[] = { }; DECLARE_MODULE_AV1(whois_global_spy, NULL, NULL, NULL, NULL, whois_global_hfnlist, - "$Revision: 498 $"); + "$Revision: 3161 $"); void show_whois_global(hook_data_client *data) @@ -47,9 +47,9 @@ show_whois_global(hook_data_client *data) if(MyClient(target_p) && IsOper(target_p) && (source_p != target_p) && (target_p->snomask & SNO_SPY)) { - sendto_one(target_p, - ":%s NOTICE %s :*** Notice -- %s (%s@%s) is doing a whois on you [%s]", - me.name, target_p->name, source_p->name, + sendto_one_notice(target_p, + ":*** Notice -- %s (%s@%s) is doing a whois on you [%s]", + source_p->name, source_p->username, source_p->host, source_p->user->server); } diff --git a/include/serno.h b/include/serno.h index eea1587..c1a0a9b 100644 --- a/include/serno.h +++ b/include/serno.h @@ -1 +1 @@ -#define SERNO "20070125-3157" +#define SERNO "20070125-3159" diff --git a/modules/core/m_die.c b/modules/core/m_die.c index 49f5bcf..3c2c7a1 100644 --- a/modules/core/m_die.c +++ b/modules/core/m_die.c @@ -21,7 +21,7 @@ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 * USA * - * $Id: m_die.c 98 2005-09-11 03:37:47Z nenolod $ + * $Id: m_die.c 3161 2007-01-25 07:23:01Z nenolod $ */ #include "stdinc.h" @@ -48,7 +48,7 @@ static struct Message die_msgtab = { mapi_clist_av1 die_clist[] = { &die_msgtab, NULL }; -DECLARE_MODULE_AV1(die, NULL, NULL, die_clist, NULL, NULL, "$Revision: 98 $"); +DECLARE_MODULE_AV1(die, NULL, NULL, die_clist, NULL, NULL, "$Revision: 3161 $"); /* * mo_die - DIE command handler @@ -67,14 +67,12 @@ mo_die(struct Client *client_p __unused, struct Client *source_p, int parc, cons if(parc < 2 || EmptyString(parv[1])) { - sendto_one(source_p, ":%s NOTICE %s :Need server name /die %s", - me.name, source_p->name, me.name); + sendto_one_notice(source_p, ":Need server name /die %s", me.name); return 0; } else if(irccmp(parv[1], me.name)) { - sendto_one(source_p, ":%s NOTICE %s :Mismatch on /die %s", - me.name, source_p->name, me.name); + sendto_one_notice(source_p, ":Mismatch on /die %s", me.name); return 0; } @@ -82,9 +80,7 @@ mo_die(struct Client *client_p __unused, struct Client *source_p, int parc, cons { target_p = ptr->data; - sendto_one(target_p, - ":%s NOTICE %s :Server Terminating. %s", - me.name, target_p->name, get_client_name(source_p, HIDE_IP)); + sendto_one_notice(target_p, ":Server Terminating. %s", get_client_name(source_p, HIDE_IP)); } DLINK_FOREACH(ptr, serv_list.head) diff --git a/modules/core/m_kill.c b/modules/core/m_kill.c index 5a07abf..c116b90 100644 --- a/modules/core/m_kill.c +++ b/modules/core/m_kill.c @@ -21,7 +21,7 @@ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 * USA * - * $Id: m_kill.c 2755 2006-11-10 19:08:03Z jilles $ + * $Id: m_kill.c 3161 2007-01-25 07:23:01Z nenolod $ */ #include "stdinc.h" @@ -55,7 +55,7 @@ struct Message kill_msgtab = { mapi_clist_av1 kill_clist[] = { &kill_msgtab, NULL }; -DECLARE_MODULE_AV1(kill, NULL, NULL, kill_clist, NULL, NULL, "$Revision: 2755 $"); +DECLARE_MODULE_AV1(kill, NULL, NULL, kill_clist, NULL, NULL, "$Revision: 3161 $"); /* ** mo_kill @@ -106,14 +106,14 @@ mo_kill(struct Client *client_p, struct Client *source_p, int parc, const char * form_str(ERR_NOSUCHNICK), user); return 0; } - sendto_one(source_p, ":%s NOTICE %s :KILL changed from %s to %s", - me.name, parv[0], user, target_p->name); + sendto_one_notice(source_p, ":KILL changed from %s to %s", user, target_p->name); } if(!MyConnect(target_p) && (!IsOperGlobalKill(source_p))) { - sendto_one(source_p, ":%s NOTICE %s :Nick %s isnt on your server", - me.name, parv[0], target_p->name); + sendto_one_notice(source_p, ":Nick %s is not on your server " + "and you do not have the global_kill flag", + target_p->name); return 0; } @@ -125,8 +125,9 @@ mo_kill(struct Client *client_p, struct Client *source_p, int parc, const char * /* Do not change the format of this message. There's no point in changing messages * that have been around for ever, for no reason.. */ sendto_realops_snomask(SNO_GENERAL, L_ALL, - "Received KILL message for %s. From %s Path: %s (%s)", - target_p->name, parv[0], me.name, reason); + "Received KILL message for %s[%s@%s]. From %s Path: %s (%s)", + target_p->name, target_p->username, target_p->host, + parv[0], me.name, reason); ilog(L_KILL, "%c %s %s!%s@%s %s %s", MyConnect(target_p) ? 'L' : 'G', get_oper_name(source_p), @@ -244,9 +245,10 @@ ms_kill(struct Client *client_p, struct Client *source_p, int parc, const char * if(IsOper(source_p)) /* send it normally */ { sendto_realops_snomask(IsService(source_p) ? SNO_SKILL : SNO_GENERAL, L_ALL, - "Received KILL message for %s. From %s Path: %s!%s!%s!%s %s", - target_p->name, parv[0], source_p->user->server, - source_p->host, source_p->username, source_p->name, reason); + "Received KILL message for %s[%s@%s]. From %s Path: %s!%s!%s!%s %s", + target_p->name, target_p->username, target_p->host, parv[0], + source_p->user->server, source_p->host, source_p->username, + source_p->name, reason); ilog(L_KILL, "%c %s %s!%s@%s %s %s", MyConnect(target_p) ? 'O' : 'R', get_oper_name(source_p), @@ -256,8 +258,9 @@ ms_kill(struct Client *client_p, struct Client *source_p, int parc, const char * else { sendto_realops_snomask(SNO_SKILL, L_ALL, - "Received KILL message for %s. From %s %s", - target_p->name, parv[0], reason); + "Received KILL message for %s[%s@%s]. From %s %s", + target_p->name, target_p->username, target_p->host, + parv[0], reason); ilog(L_KILL, "S %s %s!%s@%s %s %s", source_p->name, target_p->name, target_p->username, diff --git a/modules/core/m_squit.c b/modules/core/m_squit.c index cf7a761..7840c4b 100644 --- a/modules/core/m_squit.c +++ b/modules/core/m_squit.c @@ -21,7 +21,7 @@ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 * USA * - * $Id: m_squit.c 698 2006-02-04 18:26:55Z jilles $ + * $Id: m_squit.c 3161 2007-01-25 07:23:01Z nenolod $ */ #include "stdinc.h" @@ -50,7 +50,7 @@ struct Message squit_msgtab = { mapi_clist_av1 squit_clist[] = { &squit_msgtab, NULL }; -DECLARE_MODULE_AV1(squit, NULL, NULL, squit_clist, NULL, NULL, "$Revision: 698 $"); +DECLARE_MODULE_AV1(squit, NULL, NULL, squit_clist, NULL, NULL, "$Revision: 3161 $"); struct squit_parms { @@ -210,8 +210,8 @@ find_squit(struct Client *client_p, struct Client *source_p, const char *server) if(IsClient(client_p)) { if(MyClient(client_p)) - sendto_one(source_p, ":%s NOTICE %s :You are trying to squit me.", - me.name, client_p->name); + sendto_one_notice(source_p, ":You are trying to squit me."); + return NULL; } else diff --git a/modules/m_challenge.c b/modules/m_challenge.c index 5fab030..ef708d2 100644 --- a/modules/m_challenge.c +++ b/modules/m_challenge.c @@ -21,7 +21,7 @@ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 * USA * - * $Id: m_challenge.c 1483 2006-05-27 18:58:12Z jilles $ + * $Id: m_challenge.c 3161 2007-01-25 07:23:01Z nenolod $ */ #include "stdinc.h" @@ -70,7 +70,7 @@ static int challenge_load(void) #endif } -DECLARE_MODULE_AV1(challenge, challenge_load, NULL, NULL, NULL, NULL, "$Revision: 1483 $"); +DECLARE_MODULE_AV1(challenge, challenge_load, NULL, NULL, NULL, NULL, "$Revision: 3161 $"); #else static int m_challenge(struct Client *, struct Client *, int, const char **); @@ -82,7 +82,7 @@ struct Message challenge_msgtab = { }; mapi_clist_av1 challenge_clist[] = { &challenge_msgtab, NULL }; -DECLARE_MODULE_AV1(challenge, NULL, NULL, challenge_clist, NULL, NULL, "$Revision: 1483 $"); +DECLARE_MODULE_AV1(challenge, NULL, NULL, challenge_clist, NULL, NULL, "$Revision: 3161 $"); static int generate_challenge(char **r_challenge, char **r_response, RSA * key); @@ -220,8 +220,7 @@ m_challenge(struct Client *client_p, struct Client *source_p, int parc, const ch if(!oper_p->rsa_pubkey) { - sendto_one(source_p, ":%s NOTICE %s :I'm sorry, PK authentication " - "is not enabled for your oper{} block.", me.name, parv[0]); + sendto_one_notice(source_p, ":I'm sorry, PK authentication is not enabled for your oper{} block."); return 0; } diff --git a/modules/m_connect.c b/modules/m_connect.c index 6615c5d..34f9c00 100644 --- a/modules/m_connect.c +++ b/modules/m_connect.c @@ -21,7 +21,7 @@ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 * USA * - * $Id: m_connect.c 254 2005-09-21 23:35:12Z nenolod $ + * $Id: m_connect.c 3161 2007-01-25 07:23:01Z nenolod $ */ #include "stdinc.h" @@ -49,7 +49,7 @@ struct Message connect_msgtab = { }; mapi_clist_av1 connect_clist[] = { &connect_msgtab, NULL }; -DECLARE_MODULE_AV1(connect, NULL, NULL, connect_clist, NULL, NULL, "$Revision: 254 $"); +DECLARE_MODULE_AV1(connect, NULL, NULL, connect_clist, NULL, NULL, "$Revision: 3161 $"); /* * mo_connect - CONNECT command handler @@ -84,8 +84,8 @@ mo_connect(struct Client *client_p, struct Client *source_p, int parc, const cha if((target_p = find_server(source_p, parv[1]))) { - sendto_one(source_p, ":%s NOTICE %s :Connect: Server %s already exists from %s.", - me.name, parv[0], parv[1], target_p->from->name); + sendto_one_notice(source_p, ":Connect: Server %s already exists from %s.", parv[1], + target_p->from->name); return 0; } @@ -94,9 +94,7 @@ mo_connect(struct Client *client_p, struct Client *source_p, int parc, const cha */ if((server_p = find_server_conf(parv[1])) == NULL) { - sendto_one(source_p, - "NOTICE %s :Connect: Host %s not listed in ircd.conf", - parv[0], parv[1]); + sendto_one_notice(source_p, ":Connect: Host %s not listed in ircd.conf", parv[1]); return 0; } @@ -110,14 +108,13 @@ mo_connect(struct Client *client_p, struct Client *source_p, int parc, const cha { if((port = atoi(parv[2])) <= 0) { - sendto_one(source_p, "NOTICE %s :Connect: Illegal port number", parv[0]); + sendto_one_notice(source_p, ":Connect: Illegal port number"); return 0; } } else if(port <= 0 && (port = PORTNUM) <= 0) { - sendto_one(source_p, ":%s NOTICE %s :Connect: missing port number", - me.name, parv[0]); + sendto_one_notice(source_p, ":Connect: missing port number"); return 0; } /* @@ -134,19 +131,18 @@ mo_connect(struct Client *client_p, struct Client *source_p, int parc, const cha if(serv_connect(server_p, source_p)) { #ifndef HIDE_SERVERS_IPS - sendto_one(source_p, ":%s NOTICE %s :*** Connecting to %s[%s].%d", - me.name, parv[0], server_p->host, server_p->name, server_p->port); + sendto_one_notice(source_p, ":*** Connecting to %s[%s].%d", + server_p->host, server_p->name, server_p->port); #else - sendto_one(source_p, ":%s NOTICE %s :*** Connecting to %s.%d", - me.name, parv[0], server_p->name, server_p->port); + sendto_one_notice(source_p, ":*** Connecting to %s.%d", + server_p->name, server_p->port); #endif } else { - sendto_one(source_p, ":%s NOTICE %s :*** Couldn't connect to %s.%d", - me.name, parv[0], server_p->name, server_p->port); - + sendto_one_notice(source_p, ":*** Couldn't connect to %s.%d", + server_p->name, server_p->port); } /* diff --git a/modules/m_dline.c b/modules/m_dline.c index e5bd03d..98ac142 100644 --- a/modules/m_dline.c +++ b/modules/m_dline.c @@ -21,7 +21,7 @@ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 * USA * - * $Id: m_dline.c 3051 2006-12-27 00:02:32Z jilles $ + * $Id: m_dline.c 3161 2007-01-25 07:23:01Z nenolod $ */ #include "stdinc.h" @@ -59,7 +59,7 @@ struct Message undline_msgtab = { }; mapi_clist_av1 dline_clist[] = { &dline_msgtab, &undline_msgtab, NULL }; -DECLARE_MODULE_AV1(dline, NULL, NULL, dline_clist, NULL, NULL, "$Revision: 3051 $"); +DECLARE_MODULE_AV1(dline, NULL, NULL, dline_clist, NULL, NULL, "$Revision: 3161 $"); static int valid_comment(char *comment); static int flush_write(struct Client *, FILE *, char *, char *); @@ -274,8 +274,7 @@ mo_undline(struct Client *client_p, struct Client *source_p, int parc, const cha if(parse_netmask(cidr, NULL, NULL) == HM_HOST) { - sendto_one(source_p, ":%s NOTICE %s :Invalid D-Line", - me.name, source_p->name); + sendto_one_notice(source_p, ":Invalid D-Line"); return 0; } @@ -426,8 +425,7 @@ flush_write(struct Client *source_p, FILE * out, char *buf, char *temppath) if(error_on_write) { - sendto_one(source_p, ":%s NOTICE %s :Unable to write to %s", - me.name, source_p->name, temppath); + sendto_one_notice(source_p, ":Unable to write to %s", temppath); fclose(out); if(temppath != NULL) (void) unlink(temppath); diff --git a/modules/m_etrace.c b/modules/m_etrace.c index 30b5b98..d456845 100644 --- a/modules/m_etrace.c +++ b/modules/m_etrace.c @@ -29,7 +29,7 @@ * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE * POSSIBILITY OF SUCH DAMAGE. * - * $Id: m_etrace.c 2775 2006-11-27 11:45:31Z jilles $ + * $Id: m_etrace.c 3161 2007-01-25 07:23:01Z nenolod $ */ #include "stdinc.h" @@ -70,7 +70,7 @@ struct Message masktrace_msgtab = { }; mapi_clist_av1 etrace_clist[] = { &etrace_msgtab, &chantrace_msgtab, &masktrace_msgtab, NULL }; -DECLARE_MODULE_AV1(etrace, NULL, NULL, etrace_clist, NULL, NULL, "$Revision: 2775 $"); +DECLARE_MODULE_AV1(etrace, NULL, NULL, etrace_clist, NULL, NULL, "$Revision: 3161 $"); static void do_etrace(struct Client *source_p, int ipv4, int ipv6); static void do_etrace_full(struct Client *source_p); @@ -393,7 +393,7 @@ mo_masktrace(struct Client *client_p, struct Client *source_p, int parc, if((hostname = strchr(name, '@')) == NULL) { - sendto_one(source_p, ":%s NOTICE %s :Invalid parameters", me.name, source_p->name); + sendto_one_notice(source_p, ":Invalid parameters"); return 0; } @@ -408,7 +408,7 @@ mo_masktrace(struct Client *client_p, struct Client *source_p, int parc, if(EmptyString(username) || EmptyString(hostname)) { - sendto_one(source_p, ":%s NOTICE %s :Invalid parameters", me.name, source_p->name); + sendto_one_notice(source_p, ":Invalid parameters"); return 0; } diff --git a/modules/m_gline.c b/modules/m_gline.c index d644bca..5c31553 100644 --- a/modules/m_gline.c +++ b/modules/m_gline.c @@ -21,7 +21,7 @@ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 * USA * - * $Id: m_gline.c 1146 2006-04-07 22:52:35Z jilles $ + * $Id: m_gline.c 3161 2007-01-25 07:23:01Z nenolod $ */ #include "stdinc.h" @@ -63,7 +63,7 @@ struct Message ungline_msgtab = { }; mapi_clist_av1 gline_clist[] = { &gline_msgtab, &ungline_msgtab, NULL }; -DECLARE_MODULE_AV1(gline, NULL, NULL, gline_clist, NULL, NULL, "$Revision: 1146 $"); +DECLARE_MODULE_AV1(gline, NULL, NULL, gline_clist, NULL, NULL, "$Revision: 3161 $"); static int majority_gline(struct Client *source_p, const char *user, const char *host, const char *reason); @@ -93,8 +93,7 @@ mo_gline(struct Client *client_p, struct Client *source_p, int parc, const char if(!ConfigFileEntry.glines) { - sendto_one(source_p, ":%s NOTICE %s :GLINE disabled, perhaps you want a clustered or remote KLINE?", - me.name, source_p->name); + sendto_one_notice(source_p, ":GLINE disabled, perhaps you want a clustered or remote KLINE?"); return 0; } @@ -123,9 +122,7 @@ mo_gline(struct Client *client_p, struct Client *source_p, int parc, const char /* ok, its not a host.. abort */ if(strchr(parv[1], '.') == NULL) { - sendto_one(source_p, - ":%s NOTICE %s :Invalid parameters", - me.name, source_p->name); + sendto_one_notice(source_p, ":Invalid parameters"); return 0; } @@ -142,10 +139,8 @@ mo_gline(struct Client *client_p, struct Client *source_p, int parc, const char if(check_wild_gline(user, host)) { if(MyClient(source_p)) - sendto_one(source_p, - ":%s NOTICE %s :Please include at least %d non-wildcard " - "characters with the user@host", - me.name, source_p->name, + sendto_one_notice(source_p, + ":Please include at least %d non-wildcard characters with the user@host", ConfigFileEntry.min_nonwildcard); return 0; } @@ -160,8 +155,7 @@ mo_gline(struct Client *client_p, struct Client *source_p, int parc, const char { if(bitlen < ConfigFileEntry.gline_min_cidr) { - sendto_one(source_p, ":%s NOTICE %s :Cannot set G-Lines with cidr length < %d", - me.name, source_p->name, + sendto_one_notice(source_p, ":Cannot set G-Lines with cidr length < %d", ConfigFileEntry.gline_min_cidr); return 0; } @@ -169,8 +163,7 @@ mo_gline(struct Client *client_p, struct Client *source_p, int parc, const char /* ipv6 */ else if(bitlen < ConfigFileEntry.gline_min_cidr6) { - sendto_one(source_p, ":%s NOTICE %s :Cannot set G-Lines with cidr length < %d", - me.name, source_p->name, + sendto_one_notice(source_p, ":Cannot set G-Lines with cidr length < %d", ConfigFileEntry.gline_min_cidr6); return 0; } @@ -402,7 +395,7 @@ mo_ungline(struct Client *client_p, struct Client *source_p, int parc, const cha if(!ConfigFileEntry.glines) { - sendto_one(source_p, ":%s NOTICE %s :UNGLINE disabled, perhaps you want UNKLINE?", me.name, parv[0]); + sendto_one_notice(source_p, ":UNGLINE disabled, perhaps you want UNKLINE?"); return 0; } @@ -438,14 +431,13 @@ mo_ungline(struct Client *client_p, struct Client *source_p, int parc, const cha } else { - sendto_one(source_p, ":%s NOTICE %s :Invalid parameters", me.name, parv[0]); + sendto_one_notice(source_p, ":Invalid parameters"); return 0; } if(remove_temp_gline(user, host)) { - sendto_one(source_p, ":%s NOTICE %s :Un-glined [%s@%s]", - me.name, parv[0], user, host); + sendto_one_notice(source_p, ":Un-glined [%s@%s]", user, host); sendto_realops_snomask(SNO_GENERAL, L_ALL, "%s has removed the G-Line for: [%s@%s]", get_oper_name(source_p), user, host); @@ -455,8 +447,7 @@ mo_ungline(struct Client *client_p, struct Client *source_p, int parc, const cha } else { - sendto_one(source_p, ":%s NOTICE %s :No G-Line for %s@%s", - me.name, parv[0], user, host); + sendto_one_notice(source_p, ":No G-Line for %s@%s", user, host); } return 0; @@ -519,8 +510,7 @@ invalid_gline(struct Client *source_p, const char *luser, { if(strchr(luser, '!')) { - sendto_one(source_p, ":%s NOTICE %s :Invalid character '!' in gline", - me.name, source_p->name); + sendto_one_notice(source_p, ":Invalid character '!' in gline"); return 1; } diff --git a/modules/m_kline.c b/modules/m_kline.c index cbe6829..3c1c40f 100644 --- a/modules/m_kline.c +++ b/modules/m_kline.c @@ -21,7 +21,7 @@ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 * USA * - * $Id: m_kline.c 3063 2006-12-27 00:47:45Z jilles $ + * $Id: m_kline.c 3161 2007-01-25 07:23:01Z nenolod $ */ #include "stdinc.h" @@ -65,7 +65,7 @@ struct Message unkline_msgtab = { }; mapi_clist_av1 kline_clist[] = { &kline_msgtab, &unkline_msgtab, NULL }; -DECLARE_MODULE_AV1(kline, NULL, NULL, kline_clist, NULL, NULL, "$Revision: 3063 $"); +DECLARE_MODULE_AV1(kline, NULL, NULL, kline_clist, NULL, NULL, "$Revision: 3161 $"); /* Local function prototypes */ static int find_user_host(struct Client *source_p, const char *userhost, char *user, char *host); @@ -387,7 +387,7 @@ mo_unkline(struct Client *client_p, struct Client *source_p, int parc, const cha } else { - sendto_one(source_p, ":%s NOTICE %s :Invalid parameters", me.name, source_p->name); + sendto_one_notice(source_p, ":Invalid parameters"); return 0; } @@ -413,9 +413,7 @@ mo_unkline(struct Client *client_p, struct Client *source_p, int parc, const cha if(remove_temp_kline(user, host)) { - sendto_one(source_p, - ":%s NOTICE %s :Un-klined [%s@%s] from temporary k-lines", - me.name, parv[0], user, host); + sendto_one_notice(source_p, ":Un-klined [%s@%s] from temporary k-lines", user, host); sendto_realops_snomask(SNO_GENERAL, L_ALL, "%s has removed the temporary K-Line for: [%s@%s]", get_oper_name(source_p), user, host); diff --git a/modules/m_rehash.c b/modules/m_rehash.c index db0ab4d..e979a58 100644 --- a/modules/m_rehash.c +++ b/modules/m_rehash.c @@ -21,7 +21,7 @@ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 * USA * - * $Id: m_rehash.c 932 2006-03-05 03:39:14Z nenolod $ + * $Id: m_rehash.c 3161 2007-01-25 07:23:01Z nenolod $ */ #include "stdinc.h" @@ -55,7 +55,7 @@ struct Message rehash_msgtab = { }; mapi_clist_av1 rehash_clist[] = { &rehash_msgtab, NULL }; -DECLARE_MODULE_AV1(rehash, NULL, NULL, rehash_clist, NULL, NULL, "$Revision: 932 $"); +DECLARE_MODULE_AV1(rehash, NULL, NULL, rehash_clist, NULL, NULL, "$Revision: 3161 $"); struct hash_commands { @@ -332,8 +332,7 @@ do_rehash(struct Client *source_p, const char *type) strlcat(cmdbuf, " ", sizeof(cmdbuf)); strlcat(cmdbuf, rehash_commands[x].cmd, sizeof(cmdbuf)); } - sendto_one(source_p, ":%s NOTICE %s :rehash one of:%s", me.name, source_p->name, - cmdbuf); + sendto_one_notice(source_p, ":rehash one of:%s", cmdbuf); } else { diff --git a/modules/m_restart.c b/modules/m_restart.c index aac90db..04ef906 100644 --- a/modules/m_restart.c +++ b/modules/m_restart.c @@ -21,7 +21,7 @@ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 * USA * - * $Id: m_restart.c 254 2005-09-21 23:35:12Z nenolod $ + * $Id: m_restart.c 3161 2007-01-25 07:23:01Z nenolod $ */ #include "stdinc.h" @@ -48,7 +48,7 @@ struct Message restart_msgtab = { }; mapi_clist_av1 restart_clist[] = { &restart_msgtab, NULL }; -DECLARE_MODULE_AV1(restart, NULL, NULL, restart_clist, NULL, NULL, "$Revision: 254 $"); +DECLARE_MODULE_AV1(restart, NULL, NULL, restart_clist, NULL, NULL, "$Revision: 3161 $"); /* * mo_restart @@ -70,14 +70,12 @@ mo_restart(struct Client *client_p, struct Client *source_p, int parc, const cha if(parc < 2 || EmptyString(parv[1])) { - sendto_one(source_p, ":%s NOTICE %s :Need server name /restart %s", - me.name, source_p->name, me.name); + sendto_one_notice(source_p, ":Need server name /restart %s", me.name); return 0; } else if(irccmp(parv[1], me.name)) { - sendto_one(source_p, ":%s NOTICE %s :Mismatch on /restart %s", - me.name, source_p->name, me.name); + sendto_one_notice(source_p, ":Mismatch on /restart %s", me.name); return 0; } @@ -85,9 +83,7 @@ mo_restart(struct Client *client_p, struct Client *source_p, int parc, const cha { target_p = ptr->data; - sendto_one(target_p, - ":%s NOTICE %s :Server Restarting. %s", - me.name, target_p->name, get_client_name(source_p, HIDE_IP)); + sendto_one_notice(target_p, ":Server Restarting. %s", get_client_name(source_p, HIDE_IP)); } DLINK_FOREACH(ptr, serv_list.head) diff --git a/modules/m_set.c b/modules/m_set.c index d045b36..380350d 100644 --- a/modules/m_set.c +++ b/modules/m_set.c @@ -21,7 +21,7 @@ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 * USA * - * $Id: m_set.c 494 2006-01-15 16:08:28Z jilles $ + * $Id: m_set.c 3161 2007-01-25 07:23:01Z nenolod $ */ /* rewritten by jdc */ @@ -52,7 +52,7 @@ struct Message set_msgtab = { }; mapi_clist_av1 set_clist[] = { &set_msgtab, NULL }; -DECLARE_MODULE_AV1(set, NULL, NULL, set_clist, NULL, NULL, "$Revision: 494 $"); +DECLARE_MODULE_AV1(set, NULL, NULL, set_clist, NULL, NULL, "$Revision: 3161 $"); /* Structure used for the SET table itself */ struct SetStruct @@ -124,8 +124,7 @@ list_quote_commands(struct Client *source_p) int j = 0; const char *names[4]; - sendto_one(source_p, ":%s NOTICE %s :Available QUOTE SET commands:", - me.name, source_p->name); + sendto_one_notice(source_p, ":Available QUOTE SET commands:"); names[0] = names[1] = names[2] = names[3] = ""; @@ -135,16 +134,16 @@ list_quote_commands(struct Client *source_p) if(j > 3) { - sendto_one(source_p, ":%s NOTICE %s :%s %s %s %s", - me.name, source_p->name, names[0], names[1], names[2], names[3]); + sendto_one_notice(source_p, ":%s %s %s %s", + names[0], names[1], names[2], names[3]); j = 0; names[0] = names[1] = names[2] = names[3] = ""; } } if(j) - sendto_one(source_p, ":%s NOTICE %s :%s %s %s %s", - me.name, source_p->name, names[0], names[1], names[2], names[3]); + sendto_one_notice(source_p, ":%s %s %s %s", + names[0], names[1], names[2], names[3]); } /* SET AUTOCONN */ @@ -167,8 +166,8 @@ quote_autoconnall(struct Client *source_p, int newval) } else { - sendto_one(source_p, ":%s NOTICE %s :AUTOCONNALL is currently %i", - me.name, source_p->name, GlobalSetOptions.autoconn); + sendto_one_notice(source_p, ":AUTOCONNALL is currently %i", + GlobalSetOptions.autoconn); } } @@ -186,8 +185,8 @@ quote_floodcount(struct Client *source_p, int newval) } else { - sendto_one(source_p, ":%s NOTICE %s :FLOODCOUNT is currently %i", - me.name, source_p->name, GlobalSetOptions.floodcount); + sendto_one_notice(source_p, ":FLOODCOUNT is currently %i", + GlobalSetOptions.floodcount); } } @@ -210,8 +209,8 @@ quote_identtimeout(struct Client *source_p, int newval) GlobalSetOptions.ident_timeout = newval; } else - sendto_one(source_p, ":%s NOTICE %s :IDENTTIMEOUT is currently %d", - me.name, source_p->name, GlobalSetOptions.ident_timeout); + sendto_one_notice(source_p, ":IDENTTIMEOUT is currently %d", + GlobalSetOptions.ident_timeout); } /* SET IDLETIME */ @@ -236,8 +235,8 @@ quote_idletime(struct Client *source_p, int newval) } else { - sendto_one(source_p, ":%s NOTICE %s :IDLETIME is currently %i", - me.name, source_p->name, GlobalSetOptions.idletime / 60); + sendto_one_notice(source_p, ":IDLETIME is currently %i", + GlobalSetOptions.idletime / 60); } } @@ -249,18 +248,15 @@ quote_max(struct Client *source_p, int newval) { if(newval > MASTER_MAX) { - sendto_one(source_p, - ":%s NOTICE %s :You cannot set MAXCLIENTS to > MASTER_MAX (%d)", - me.name, source_p->name, MASTER_MAX); + sendto_one_notice(source_p, ":You cannot set MAXCLIENTS to > MASTER_MAX (%d)", + MASTER_MAX); return; } if(newval < 32) { - sendto_one(source_p, - ":%s NOTICE %s :You cannot set MAXCLIENTS to < 32 (%d:%d)", - me.name, source_p->name, GlobalSetOptions.maxclients, - highest_fd); + sendto_one_notice(source_p, ":You cannot set MAXCLIENTS to < 32 (%d:%d)", + GlobalSetOptions.maxclients, highest_fd); return; } @@ -276,9 +272,8 @@ quote_max(struct Client *source_p, int newval) } else { - sendto_one(source_p, ":%s NOTICE %s :Current Maxclients = %d (%lu)", - me.name, source_p->name, GlobalSetOptions.maxclients, - dlink_list_length(&lclient_list)); + sendto_one_notice(source_p, ":Current Maxclients = %d (%lu)", + GlobalSetOptions.maxclients, dlink_list_length(&lclient_list)); } } @@ -288,8 +283,7 @@ quote_operstring(struct Client *source_p, const char *arg) { if(EmptyString(arg)) { - sendto_one(source_p, ":%s NOTICE %s :OPERSTRING is currently '%s'", - me.name, source_p->name, GlobalSetOptions.operstring); + sendto_one_notice(source_p, ":OPERSTRING is currently '%s'", GlobalSetOptions.operstring); } else { @@ -308,8 +302,7 @@ quote_adminstring(struct Client *source_p, const char *arg) { if(EmptyString(arg)) { - sendto_one(source_p, ":%s NOTICE %s :ADMINSTRING is currently '%s'", - me.name, source_p->name, GlobalSetOptions.adminstring); + sendto_one_notice(source_p, ":ADMINSTRING is currently '%s'", GlobalSetOptions.adminstring); } else { @@ -348,8 +341,7 @@ quote_spamnum(struct Client *source_p, int newval) } else { - sendto_one(source_p, ":%s NOTICE %s :SPAMNUM is currently %i", - me.name, source_p->name, GlobalSetOptions.spam_num); + sendto_one_notice(source_p, ":SPAMNUM is currently %i", GlobalSetOptions.spam_num); } } @@ -372,8 +364,7 @@ quote_spamtime(struct Client *source_p, int newval) } else { - sendto_one(source_p, ":%s NOTICE %s :SPAMTIME is currently %i", - me.name, source_p->name, GlobalSetOptions.spam_time); + sendto_one_notice(source_p, ":SPAMTIME is currently %i", GlobalSetOptions.spam_time); } } @@ -448,8 +439,7 @@ quote_splitmode(struct Client *source_p, char *charval) * pull values back out of, splitmode can be four states - but you can * only set to three, which means we cant use the same table --fl_ */ - sendto_one(source_p, ":%s NOTICE %s :SPLITMODE is currently %s", - me.name, source_p->name, + sendto_one_notice(source_p, ":SPLITMODE is currently %s", splitmode_status[(splitchecking + (splitmode * 2))]); } @@ -467,8 +457,7 @@ quote_splitnum(struct Client *source_p, int newval) check_splitmode(NULL); } else - sendto_one(source_p, ":%s NOTICE %s :SPLITNUM is currently %i", - me.name, source_p->name, split_servers); + sendto_one_notice(source_p, ":SPLITNUM is currently %i", split_servers); } /* SET SPLITUSERS */ @@ -485,8 +474,7 @@ quote_splitusers(struct Client *source_p, int newval) check_splitmode(NULL); } else - sendto_one(source_p, ":%s NOTICE %s :SPLITUSERS is currently %i", - me.name, source_p->name, split_users); + sendto_one_notice(source_p, ":SPLITUSERS is currently %i", split_users); } /* @@ -530,9 +518,8 @@ mo_set(struct Client *client_p, struct Client *source_p, int parc, const char *p if((n - 1) > parc) { - sendto_one(source_p, - ":%s NOTICE %s :SET %s expects (\"%s%s\") args", - me.name, source_p->name, + sendto_one_notice(source_p, + ":SET %s expects (\"%s%s\") args", set_cmd_table[i].name, (set_cmd_table[i]. wants_char ? "string, " : ""), @@ -566,9 +553,8 @@ mo_set(struct Client *client_p, struct Client *source_p, int parc, const char *p if(newval < 0) { - sendto_one(source_p, - ":%s NOTICE %s :Value less than 0 illegal for %s", - me.name, source_p->name, + sendto_one_notice(source_p, + ":Value less than 0 illegal for %s", set_cmd_table[i].name); return 0; @@ -602,7 +588,7 @@ mo_set(struct Client *client_p, struct Client *source_p, int parc, const char *p * Code here will be executed when a /QUOTE SET command is not * found within set_cmd_table. */ - sendto_one(source_p, ":%s NOTICE %s :Variable not found.", me.name, parv[0]); + sendto_one_notice(source_p, ":Variable not found."); return 0; } diff --git a/modules/m_testmask.c b/modules/m_testmask.c index 2fa4eea..9acb6f4 100644 --- a/modules/m_testmask.c +++ b/modules/m_testmask.c @@ -29,7 +29,7 @@ * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE * POSSIBILITY OF SUCH DAMAGE. * - * $Id: m_testmask.c 2775 2006-11-27 11:45:31Z jilles $ + * $Id: m_testmask.c 3161 2007-01-25 07:23:01Z nenolod $ * */ @@ -57,7 +57,7 @@ struct Message testmask_msgtab = { }; mapi_clist_av1 testmask_clist[] = { &testmask_msgtab, NULL }; -DECLARE_MODULE_AV1(testmask, NULL, NULL, testmask_clist, NULL, NULL, "$Revision: 2775 $"); +DECLARE_MODULE_AV1(testmask, NULL, NULL, testmask_clist, NULL, NULL, "$Revision: 3161 $"); static const char *empty_sockhost = "255.255.255.255"; static const char *spoofed_sockhost = "0"; @@ -80,8 +80,7 @@ mo_testmask(struct Client *client_p, struct Client *source_p, /* username is required */ if((hostname = strchr(name, '@')) == NULL) { - sendto_one(source_p, ":%s NOTICE %s :Invalid parameters", - me.name, source_p->name); + sendto_one_notice(source_p, ":Invalid parameters"); return 0; } @@ -98,8 +97,7 @@ mo_testmask(struct Client *client_p, struct Client *source_p, if(EmptyString(username) || EmptyString(hostname)) { - sendto_one(source_p, ":%s NOTICE %s :Invalid parameters", - me.name, source_p->name); + sendto_one_notice(source_p, ":Invalid parameters"); return 0; } diff --git a/modules/m_unreject.c b/modules/m_unreject.c index 7b333e8..b395ad5 100644 --- a/modules/m_unreject.c +++ b/modules/m_unreject.c @@ -20,7 +20,7 @@ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 * USA * - * $Id: m_unreject.c 254 2005-09-21 23:35:12Z nenolod $ + * $Id: m_unreject.c 3161 2007-01-25 07:23:01Z nenolod $ */ #include "stdinc.h" @@ -40,7 +40,7 @@ struct Message unreject_msgtab = { }; mapi_clist_av1 unreject_clist[] = { &unreject_msgtab, NULL }; -DECLARE_MODULE_AV1(unreject, NULL, NULL, unreject_clist, NULL, NULL, "$Revision: 254 $"); +DECLARE_MODULE_AV1(unreject, NULL, NULL, unreject_clist, NULL, NULL, "$Revision: 3161 $"); /* * mo_unreject @@ -52,23 +52,20 @@ mo_unreject(struct Client *client_p, struct Client *source_p, int parc, const ch if(ConfigFileEntry.reject_after_count == 0 || ConfigFileEntry.reject_ban_time == 0 || ConfigFileEntry.reject_duration == 0) { - sendto_one(source_p, ":%s NOTICE %s :Reject cache is disabled", - me.name, source_p->name); + sendto_one_notice(source_p, ":Reject cache is disabled"); return 0; } if(!parse_netmask(parv[1], NULL, NULL)) { - sendto_one(source_p, ":%s NOTICE %s :Unable to parse netmask %s", - me.name, source_p->name, parv[1]); + sendto_one_notice(source_p, ":Unable to parse netmask %s", parv[1]); return 0; } if(remove_reject(parv[1])) - sendto_one(source_p, ":%s NOTICE %s :Removed reject for %s", - me.name, source_p->name, parv[1]); + sendto_one_notice(source_p, ":Removed reject for %s", parv[1]); else - sendto_one(source_p, ":%s NOTICE %s :Unable to remove reject for %s", - me.name, source_p->name, parv[1]); + sendto_one_notice(source_p, ":Unable to remove reject for %s", parv[1]); + return 0; } diff --git a/modules/m_xline.c b/modules/m_xline.c index 248bf7a..a11e9c3 100644 --- a/modules/m_xline.c +++ b/modules/m_xline.c @@ -27,7 +27,7 @@ * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE * POSSIBILITY OF SUCH DAMAGE. * - * $Id: m_xline.c 3059 2006-12-27 00:36:54Z jilles $ + * $Id: m_xline.c 3161 2007-01-25 07:23:01Z nenolod $ */ #include "stdinc.h" @@ -70,7 +70,7 @@ struct Message unxline_msgtab = { }; mapi_clist_av1 xline_clist[] = { &xline_msgtab, &unxline_msgtab, NULL }; -DECLARE_MODULE_AV1(xline, NULL, NULL, xline_clist, NULL, NULL, "$Revision: 3059 $"); +DECLARE_MODULE_AV1(xline, NULL, NULL, xline_clist, NULL, NULL, "$Revision: 3161 $"); static int valid_xline(struct Client *, const char *, const char *); static void apply_xline(struct Client *client_p, const char *name, @@ -222,9 +222,7 @@ handle_remote_xline(struct Client *source_p, int temp_time, /* already xlined */ if((aconf = find_xline(name, 0)) != NULL) { - sendto_one(source_p, ":%s NOTICE %s :[%s] already X-Lined by [%s] - %s", - me.name, source_p->name, name, - aconf->name, aconf->passwd); + sendto_one_notice(source_p, ":[%s] already X-Lined by [%s] - %s", name, aconf->name, aconf->passwd); return; } diff --git a/src/chmode.c b/src/chmode.c index 1d8f711..fde7236 100644 --- a/src/chmode.c +++ b/src/chmode.c @@ -22,7 +22,7 @@ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 * USA * - * $Id: chmode.c 3131 2007-01-21 15:36:31Z jilles $ + * $Id: chmode.c 3161 2007-01-25 07:23:01Z nenolod $ */ #include "stdinc.h" @@ -964,9 +964,9 @@ chm_forward(struct Client *source_p, struct Channel *chptr, if (!(*errors & SM_ERR_RPL_F)) { if (*chptr->mode.forward == '\0') - sendto_one(source_p, ":%s NOTICE %s :%s has no forward channel", me.name, source_p->name, chptr->chname); + sendto_one_notice(source_p, ":%s has no forward channel", chptr->chname); else - sendto_one(source_p, ":%s NOTICE %s :%s forward channel is %s", me.name, source_p->name, chptr->chname, chptr->mode.forward); + sendto_one_notice(source_p, ":%s forward channel is %s", chptr->chname, chptr->mode.forward); *errors |= SM_ERR_RPL_F; } return; diff --git a/src/modules.c b/src/modules.c index d03eae1..0d0836f 100644 --- a/src/modules.c +++ b/src/modules.c @@ -21,7 +21,7 @@ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 * USA * - * $Id: modules.c 1509 2006-05-28 02:35:58Z nenolod $ + * $Id: modules.c 3161 2007-01-25 07:23:01Z nenolod $ */ #include "stdinc.h" @@ -365,9 +365,7 @@ mo_modload(struct Client *client_p, struct Client *source_p, int parc, const cha if(findmodule_byname(m_bn) != -1) { - sendto_one(source_p, - ":%s NOTICE %s :Module %s is already loaded", - me.name, source_p->name, m_bn); + sendto_one_notice(source_p, ":Module %s is already loaded", m_bn); MyFree(m_bn); return 0; } @@ -398,26 +396,23 @@ mo_modunload(struct Client *client_p, struct Client *source_p, int parc, const c if((modindex = findmodule_byname(m_bn)) == -1) { - sendto_one(source_p, - ":%s NOTICE %s :Module %s is not loaded", me.name, source_p->name, m_bn); + sendto_one_notice(source_p, ":Module %s is not loaded", m_bn); MyFree(m_bn); return 0; } if(modlist[modindex]->core == 1) { - sendto_one(source_p, - ":%s NOTICE %s :Module %s is a core module and may not be unloaded", - me.name, source_p->name, m_bn); + sendto_one_notice(source_p, ":Module %s is a core module and may not be unloaded", m_bn); MyFree(m_bn); return 0; } if(unload_one_module(m_bn, 1) == -1) { - sendto_one(source_p, - ":%s NOTICE %s :Module %s is not loaded", me.name, source_p->name, m_bn); + sendto_one_notice(source_p, ":Module %s is not loaded", m_bn); } + MyFree(m_bn); return 0; } @@ -441,8 +436,7 @@ mo_modreload(struct Client *client_p, struct Client *source_p, int parc, const c if((modindex = findmodule_byname(m_bn)) == -1) { - sendto_one(source_p, - ":%s NOTICE %s :Module %s is not loaded", me.name, source_p->name, m_bn); + sendto_one_notice(source_p, ":Module %s is not loaded", m_bn); MyFree(m_bn); return 0; } @@ -451,8 +445,7 @@ mo_modreload(struct Client *client_p, struct Client *source_p, int parc, const c if(unload_one_module(m_bn, 1) == -1) { - sendto_one(source_p, - ":%s NOTICE %s :Module %s is not loaded", me.name, source_p->name, m_bn); + sendto_one_notice(source_p, ":Module %s is not loaded", m_bn); MyFree(m_bn); return 0; } @@ -521,7 +514,7 @@ mo_modrestart(struct Client *client_p, struct Client *source_p, int parc, const return 0; } - sendto_one(source_p, ":%s NOTICE %s :Reloading all modules", me.name, parv[0]); + sendto_one_notice(source_p, ":Reloading all modules"); modnum = num_mods; while (num_mods) diff --git a/src/s_auth.c b/src/s_auth.c index 3494e5b..6224aa6 100644 --- a/src/s_auth.c +++ b/src/s_auth.c @@ -21,7 +21,7 @@ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 * USA * - * $Id: s_auth.c 1683 2006-06-20 14:26:16Z jilles $ */ + * $Id: s_auth.c 3161 2007-01-25 07:23:01Z nenolod $ */ /* * Changes: @@ -62,15 +62,15 @@ static const char *HeaderMessages[] = { - "NOTICE AUTH :*** Looking up your hostname...", - "NOTICE AUTH :*** Found your hostname", - "NOTICE AUTH :*** Couldn't look up your hostname", - "NOTICE AUTH :*** Checking Ident", - "NOTICE AUTH :*** Got Ident response", - "NOTICE AUTH :*** No Ident response", - "NOTICE AUTH :*** Your hostname is too long, ignoring hostname", - "NOTICE AUTH :*** Your forward and reverse DNS do not match, ignoring hostname", - "NOTICE AUTH :*** Cannot verify hostname validity, ignoring hostname", + ":*** Looking up your hostname...", + ":*** Found your hostname", + ":*** Couldn't look up your hostname", + ":*** Checking Ident", + ":*** Got Ident response", + ":*** No Ident response", + ":*** Your hostname is too long, ignoring hostname", + ":*** Your forward and reverse DNS do not match, ignoring hostname", + ":*** Cannot verify hostname validity, ignoring hostname", }; typedef enum @@ -87,7 +87,7 @@ typedef enum } ReportType; -#define sendheader(c, r) sendto_one(c, HeaderMessages[(r)]) +#define sendheader(c, r) sendto_one_notice(c, HeaderMessages[(r)]) static dlink_list auth_poll_list; static BlockHeap *auth_heap; @@ -400,10 +400,6 @@ start_auth(struct Client *client) if(client == NULL) return; - /* to aid bopm which needs something unique to match against */ - sendto_one(client, "NOTICE AUTH :*** Processing connection to %s", - me.name); - auth = make_auth_request(client); auth->dns_query.ptr = auth; diff --git a/src/s_conf.c b/src/s_conf.c index ca5e414..ea0dc8d 100644 --- a/src/s_conf.c +++ b/src/s_conf.c @@ -21,7 +21,7 @@ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 * USA * - * $Id: s_conf.c 3159 2007-01-25 07:08:21Z nenolod $ + * $Id: s_conf.c 3161 2007-01-25 07:23:01Z nenolod $ */ #include "stdinc.h" @@ -386,7 +386,7 @@ verify_access(struct Client *client_p, const char *username) } else if(aconf->status & CONF_GLINE) { - sendto_one(client_p, ":%s NOTICE %s :*** G-lined", me.name, client_p->name); + sendto_one_notice(client_p, ":*** G-lined"); if(ConfigFileEntry.kline_with_reason) sendto_one(client_p, @@ -597,8 +597,7 @@ attach_conf(struct Client *client_p, struct ConfItem *aconf) } else { - sendto_one(client_p, ":%s NOTICE %s :*** I: line is full, but you have an >I: line!", - me.name, client_p->name); + sendto_one_notice(client_p, ":*** I: line is full, but you have an >I: line!"); SetExemptLimits(client_p); } @@ -1355,9 +1354,7 @@ write_confitem(KlineType type, struct Client *source_p, char *user, reason, oper_reason); } - sendto_one(source_p, - ":%s NOTICE %s :Added D-Line [%s] to %s", me.name, - source_p->name, host, filename); + sendto_one_notice(source_p, ":Added D-Line [%s] to %s", host, filename); } else if(type == RESV_TYPE) diff --git a/src/s_newconf.c b/src/s_newconf.c index 97cd475..66adbec 100644 --- a/src/s_newconf.c +++ b/src/s_newconf.c @@ -29,7 +29,7 @@ * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE * POSSIBILITY OF SUCH DAMAGE. * - * $Id: s_newconf.c 1747 2006-07-25 21:22:45Z jilles $ + * $Id: s_newconf.c 3161 2007-01-25 07:23:01Z nenolod $ */ #include "stdinc.h" @@ -504,8 +504,7 @@ set_server_conf_autoconn(struct Client *source_p, char *name, int newval) get_oper_name(source_p), name, newval); } else - sendto_one(source_p, ":%s NOTICE %s :Can't find %s", - me.name, source_p->name, name); + sendto_one_notice(source_p, ":Can't find %s", name); } struct ConfItem * diff --git a/src/s_user.c b/src/s_user.c index 9007818..46c0190 100644 --- a/src/s_user.c +++ b/src/s_user.c @@ -21,7 +21,7 @@ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 * USA * - * $Id: s_user.c 3159 2007-01-25 07:08:21Z nenolod $ + * $Id: s_user.c 3161 2007-01-25 07:23:01Z nenolod $ */ #include "stdinc.h" @@ -300,9 +300,7 @@ register_local_user(struct Client *client_p, struct Client *source_p, const char if(!valid_hostname(source_p->host)) { - sendto_one(source_p, - ":%s NOTICE %s :*** Notice -- You have an illegal character in your hostname", - me.name, source_p->name); + sendto_one_notice(source_p, ":*** Notice -- You have an illegal character in your hostname"); strlcpy(source_p->host, source_p->sockhost, sizeof(source_p->host)); @@ -329,9 +327,7 @@ register_local_user(struct Client *client_p, struct Client *source_p, const char if(IsNeedIdentd(aconf)) { ServerStats->is_ref++; - sendto_one(source_p, - ":%s NOTICE %s :*** Notice -- You need to install identd to use this server", - me.name, client_p->name); + sendto_one_notice(source_p, ":*** Notice -- You need to install identd to use this server"); exit_client(client_p, source_p, &me, "Install identd"); return (CLIENT_EXITED); } @@ -358,9 +354,7 @@ register_local_user(struct Client *client_p, struct Client *source_p, const char if(IsNeedSasl(aconf) && !*user->suser) { ServerStats->is_ref++; - sendto_one(source_p, - ":%s NOTICE %s :*** Notice -- You need to identify via SASL to use this server", - me.name, client_p->name); + sendto_one_notice(source_p, ":*** Notice -- You need to identify via SASL to use this server"); exit_client(client_p, source_p, &me, "SASL access only"); return (CLIENT_EXITED); } @@ -811,18 +805,14 @@ report_and_set_user_flags(struct Client *source_p, struct ConfItem *aconf) /* If this user is being spoofed, tell them so */ if(IsConfDoSpoofIp(aconf)) { - sendto_one(source_p, - ":%s NOTICE %s :*** Spoofing your IP. congrats.", - me.name, source_p->name); + sendto_one_notice(source_p, ":*** Spoofing your IP. congrats."); } /* If this user is in the exception class, Set it "E lined" */ if(IsConfExemptKline(aconf)) { SetExemptKline(source_p); - sendto_one(source_p, - ":%s NOTICE %s :*** You are exempt from K/D/G/X lines. congrats.", - me.name, source_p->name); + sendto_one_notice(source_p, ":*** You are exempt from K/D/G/X lines. congrats."); } if(IsConfExemptGline(aconf)) @@ -831,74 +821,56 @@ report_and_set_user_flags(struct Client *source_p, struct ConfItem *aconf) /* dont send both a kline and gline exempt notice */ if(!IsConfExemptKline(aconf)) - sendto_one(source_p, - ":%s NOTICE %s :*** You are exempt from G lines.", - me.name, source_p->name); + sendto_one_notice(source_p, ":*** You are exempt from G lines."); } if(IsConfExemptDNSBL(aconf)) /* kline exempt implies this, don't send both */ if(!IsConfExemptKline(aconf)) - sendto_one(source_p, - ":%s NOTICE %s :*** You are exempt from DNS blacklists.", - me.name, source_p->name); + sendto_one_notice(source_p, ":*** You are exempt from DNS blacklists."); /* If this user is exempt from user limits set it F lined" */ if(IsConfExemptLimits(aconf)) { SetExemptLimits(source_p); - sendto_one(source_p, - ":%s NOTICE %s :*** You are exempt from user limits. congrats.", - me.name, source_p->name); + sendto_one_notice(source_p, "*** You are exempt from user limits. congrats."); } /* If this user is exempt from idle time outs */ if(IsConfIdlelined(aconf)) { SetIdlelined(source_p); - sendto_one(source_p, - ":%s NOTICE %s :*** You are exempt from idle limits. congrats.", - me.name, source_p->name); + sendto_one_notice(source_p, ":*** You are exempt from idle limits. congrats."); } if(IsConfExemptFlood(aconf)) { SetExemptFlood(source_p); - sendto_one(source_p, - ":%s NOTICE %s :*** You are exempt from flood limits.", - me.name, source_p->name); + sendto_one_notice(source_p, ":*** You are exempt from flood limits."); } if(IsConfExemptSpambot(aconf)) { SetExemptSpambot(source_p); - sendto_one(source_p, - ":%s NOTICE %s :*** You are exempt from spambot checks.", - me.name, source_p->name); + sendto_one_notice(source_p, ":*** You are exempt from spambot checks."); } if(IsConfExemptJupe(aconf)) { SetExemptJupe(source_p); - sendto_one(source_p, - ":%s NOTICE %s :*** You are exempt from juped channel warnings.", - me.name, source_p->name); + sendto_one_notice(source_p, ":*** You are exempt from juped channel warnings."); } if(IsConfExemptResv(aconf)) { SetExemptResv(source_p); - sendto_one(source_p, - ":%s NOTICE %s :*** You are exempt from resvs.", - me.name, source_p->name); + sendto_one_notice(source_p, ":*** You are exempt from resvs."); } if(IsConfExemptShide(aconf)) { SetExemptShide(source_p); - sendto_one(source_p, - ":%s NOTICE %s :*** You are exempt from serverhiding.", - me.name, source_p->name); + sendto_one_notice(source_p, ":*** You are exempt from serverhiding."); } } @@ -1110,23 +1082,20 @@ user_mode(struct Client *client_p, struct Client *source_p, int parc, const char if(MyClient(source_p) && (source_p->snomask & SNO_NCHANGE) && !IsOperN(source_p)) { - sendto_one(source_p, - ":%s NOTICE %s :*** You need oper and N flag for +s +n", me.name, parv[0]); + sendto_one_notice(source_p, ":*** You need oper and N flag for +s +n"); source_p->snomask &= ~SNO_NCHANGE; /* only tcm's really need this */ } if(MyClient(source_p) && (source_p->umodes & UMODE_OPERWALL) && !IsOperOperwall(source_p)) { - sendto_one(source_p, - ":%s NOTICE %s :*** You need oper and operwall flag for +z", me.name, parv[0]); + sendto_one_notice(source_p, ":*** You need oper and operwall flag for +z"); source_p->umodes &= ~UMODE_OPERWALL; } if(MyConnect(source_p) && (source_p->umodes & UMODE_ADMIN) && (!IsOperAdmin(source_p) || IsOperHiddenAdmin(source_p))) { - sendto_one(source_p, - ":%s NOTICE %s :*** You need oper and A flag for +a", me.name, parv[0]); + sendto_one_notice(source_p, ":*** You need oper and A flag for +a"); source_p->umodes &= ~UMODE_ADMIN; } @@ -1261,13 +1230,8 @@ user_welcome(struct Client *source_p) if(ConfigFileEntry.short_motd) { - sendto_one(source_p, - "NOTICE %s :*** Notice -- motd was last changed at %s", - source_p->name, user_motd_changed); - - sendto_one(source_p, - "NOTICE %s :*** Notice -- Please read the motd if you haven't read it", - source_p->name); + sendto_one_notice(source_p, ":*** Notice -- motd was last changed at %s", user_motd_changed); + sendto_one_notice(source_p, ":*** Notice -- Please read the motd if you haven't read it"); sendto_one(source_p, form_str(RPL_MOTDSTART), me.name, source_p->name, me.name); @@ -1345,8 +1309,7 @@ oper_up(struct Client *source_p, struct oper_conf *oper_p) sendto_one(source_p, form_str(RPL_SNOMASK), me.name, source_p->name, construct_snobuf(source_p->snomask)); sendto_one(source_p, form_str(RPL_YOUREOPER), me.name, source_p->name); - sendto_one(source_p, ":%s NOTICE %s :*** Oper privs are %s", me.name, - source_p->name, get_oper_privs(oper_p->flags)); + sendto_one_notice(source_p, ":*** Oper privs are %s", get_oper_privs(oper_p->flags)); send_oper_motd(source_p); return (1); diff --git a/src/send.c b/src/send.c index bafeb0a..e32e7fb 100644 --- a/src/send.c +++ b/src/send.c @@ -21,7 +21,7 @@ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 * USA * - * $Id: send.c 1379 2006-05-20 14:11:07Z jilles $ + * $Id: send.c 3161 2007-01-25 07:23:01Z nenolod $ */ #include "stdinc.h" @@ -371,6 +371,7 @@ sendto_one_notice(struct Client *target_p, const char *pattern, ...) struct Client *dest_p; va_list args; buf_head_t linebuf; + char *to; /* send remote if to->from non NULL */ if(target_p->from != NULL) @@ -391,7 +392,7 @@ sendto_one_notice(struct Client *target_p, const char *pattern, ...) va_start(args, pattern); linebuf_putmsg(&linebuf, pattern, &args, ":%s NOTICE %s ", - get_id(&me, target_p), get_id(target_p, target_p)); + get_id(&me, target_p), *(to = get_id(target_p, target_p)) != '\0' ? to : "*"); va_end(args); _send_linebuf(dest_p, &linebuf); @@ -411,6 +412,7 @@ sendto_one_numeric(struct Client *target_p, int numeric, const char *pattern, .. struct Client *dest_p; va_list args; buf_head_t linebuf; + char *to; /* send remote if to->from non NULL */ if(target_p->from != NULL) @@ -432,7 +434,7 @@ sendto_one_numeric(struct Client *target_p, int numeric, const char *pattern, .. linebuf_putmsg(&linebuf, pattern, &args, ":%s %03d %s ", get_id(&me, target_p), - numeric, get_id(target_p, target_p)); + numeric, *(to = get_id(target_p, target_p)) != '\0' ? to : "*"); va_end(args); _send_linebuf(dest_p, &linebuf); diff --git a/unsupported/m_clearchan.c b/unsupported/m_clearchan.c index 505cce8..9d112f2 100644 --- a/unsupported/m_clearchan.c +++ b/unsupported/m_clearchan.c @@ -17,7 +17,7 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. * - * $Id: m_clearchan.c 1425 2006-05-23 16:41:33Z jilles $ + * $Id: m_clearchan.c 3161 2007-01-25 07:23:01Z nenolod $ */ #include "stdinc.h" #include "tools.h" @@ -46,7 +46,7 @@ struct Message clearchan_msgtab = { mapi_clist_av1 clearchan_clist[] = { &clearchan_msgtab, NULL }; -DECLARE_MODULE_AV1(clearchan, NULL, NULL, clearchan_clist, NULL, NULL, "$Revision: 1425 $"); +DECLARE_MODULE_AV1(clearchan, NULL, NULL, clearchan_clist, NULL, NULL, "$Revision: 3161 $"); /* ** mo_clearchan @@ -65,7 +65,7 @@ mo_clearchan(struct Client *client_p, struct Client *source_p, int parc, const c /* admins only */ if(!IsOperAdmin(source_p)) { - sendto_one(source_p, ":%s NOTICE %s :You have no A flag", me.name, parv[0]); + sendto_one_notice(source_p, ":You have no A flag"); return 0; } @@ -79,8 +79,7 @@ mo_clearchan(struct Client *client_p, struct Client *source_p, int parc, const c if(IsMember(source_p, chptr)) { - sendto_one(source_p, ":%s NOTICE %s :*** Please part %s before using CLEARCHAN", - me.name, source_p->name, parv[1]); + sendto_one_notice(source_p, ":*** Please part %s before using CLEARCHAN", parv[1]); return 0; } diff --git a/unsupported/m_force.c b/unsupported/m_force.c index d531977..6abe8ee 100644 --- a/unsupported/m_force.c +++ b/unsupported/m_force.c @@ -26,7 +26,7 @@ * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE * POSSIBILITY OF SUCH DAMAGE. * - * $Id: m_force.c 1425 2006-05-23 16:41:33Z jilles $ + * $Id: m_force.c 3161 2007-01-25 07:23:01Z nenolod $ */ #include "stdinc.h" @@ -70,7 +70,7 @@ struct Message forcepart_msgtab = { mapi_clist_av1 force_clist[] = { &forcejoin_msgtab, &forcepart_msgtab, NULL }; -DECLARE_MODULE_AV1(force, NULL, NULL, force_clist, NULL, NULL, "$Revision: 1425 $"); +DECLARE_MODULE_AV1(force, NULL, NULL, force_clist, NULL, NULL, "$Revision: 3161 $"); /* * m_forcejoin @@ -146,8 +146,8 @@ mo_forcejoin(struct Client *client_p, struct Client *source_p, int parc, const c if(IsMember(target_p, chptr)) { /* debugging is fun... */ - sendto_one(source_p, ":%s NOTICE %s :*** Notice -- %s is already in %s", - me.name, source_p->name, target_p->name, chptr->chname); + sendto_one_notice(source_p, ":*** Notice -- %s is already in %s", + target_p->name, chptr->chname); return 0; } @@ -198,8 +198,7 @@ mo_forcejoin(struct Client *client_p, struct Client *source_p, int parc, const c /* newch can't be longer than CHANNELLEN */ if(strlen(newch) > CHANNELLEN) { - sendto_one(source_p, ":%s NOTICE %s :Channel name is too long", me.name, - source_p->name); + sendto_one_notice(source_p, ":Channel name is too long"); return 0; } @@ -227,8 +226,7 @@ mo_forcejoin(struct Client *client_p, struct Client *source_p, int parc, const c * seen from the server handling the command instead of the server that * the oper is on. */ - sendto_one(source_p, ":%s NOTICE %s :*** Notice -- Creating channel %s", me.name, - source_p->name, chptr->chname); + sendto_one_notice(source_p, ":*** Notice -- Creating channel %s", chptr->chname); } return 0; }