X-Git-Url: https://jfr.im/git/irc/rqf/shadowircd.git/blobdiff_plain/212380e3f42f585dc1ea927402252eb943f91f7b..8a1e143f6fb3509ad390554e2c49af723794cd96:/modules/m_set.c diff --git a/modules/m_set.c b/modules/m_set.c index d045b36..b05a8ba 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 3253 2007-03-05 19:01:05Z 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: 3253 $"); /* 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); } } @@ -247,20 +246,10 @@ quote_max(struct Client *source_p, int newval) { if(newval > 0) { - 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); - 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 +265,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 +276,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 +295,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 +334,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 +357,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 +432,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 +450,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 +467,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 +511,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 +546,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 +581,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; }