diff --git a/src/modules/m_dccallow.c b/src/modules/m_dccallow.c index a9fdb9302..ecab68cc2 100644 --- a/src/modules/m_dccallow.c +++ b/src/modules/m_dccallow.c @@ -136,14 +136,12 @@ CMD_FUNC(m_dccallow) if (!didlist && !myncmp(s, "list", 4)) { didanything = didlist = 1; - sendto_one(sptr, ":%s %d %s :The following users are on your dcc allow list:", - me.name, RPL_DCCINFO, sptr->name); + sendnumericfmt(sptr, RPL_DCCINFO, "The following users are on your dcc allow list:"); for(lp = sptr->user->dccallow; lp; lp = lp->next) { if (lp->flags == DCC_LINK_REMOTE) continue; - sendto_one(sptr, ":%s %d %s :%s (%s@%s)", me.name, - RPL_DCCLIST, sptr->name, lp->value.cptr->name, + sendnumericfmt(sptr, RPL_DCCLIST, "%s (%s@%s)", lp->value.cptr->name, lp->value.cptr->user->username, GetHost(lp->value.cptr)); } @@ -153,7 +151,7 @@ CMD_FUNC(m_dccallow) { didanything = didhelp = 1; for(ptr = dcc_help; *ptr; ptr++) - sendto_one(sptr, ":%s %d %s :%s", me.name, RPL_DCCINFO, sptr->name, *ptr); + sendnumericfmt(sptr, RPL_DCCINFO, "%s", *ptr); sendnumeric(sptr, RPL_ENDOFDCCLIST, s); } } diff --git a/src/modules/m_ircops.c b/src/modules/m_ircops.c index 448d11e2b..883e5435b 100644 --- a/src/modules/m_ircops.c +++ b/src/modules/m_ircops.c @@ -136,8 +136,8 @@ CMD_FUNC(m_ircops) opers, opers != 1 ? "s" : "", aways); - sendto_one(sptr, ":%s %d %s :%s", me.name, RPL_TEXT, sptr->name, buf); - sendto_one(sptr, ":%s %d %s :End of /IRCOPS list", me.name, RPL_TEXT, sptr->name); + sendnumericfmt(sptr, RPL_TEXT, "%s", buf); + sendnumericfmt(sptr, RPL_TEXT, "End of /IRCOPS list"); return 0; } diff --git a/src/modules/m_message.c b/src/modules/m_message.c index 4f4d6cb4b..2b5270b55 100644 --- a/src/modules/m_message.c +++ b/src/modules/m_message.c @@ -614,10 +614,8 @@ int size_string, ret; if ((fl = dcc_isforbidden(sptr, realfile))) { char *displayfile = dcc_displayfile(realfile); - sendto_one(sptr, - ":%s %d %s :*** Cannot DCC SEND file %s to %s (%s)", - me.name, RPL_TEXT, - sptr->name, displayfile, target, fl->reason); + sendnumericfmt(sptr, + RPL_TEXT, "*** Cannot DCC SEND file %s to %s (%s)", displayfile, target, fl->reason); sendnotice(sptr, "*** You have been blocked from sending files, reconnect to regain permission to send files"); sptr->flags |= FLAGS_DCCBLOCK; @@ -630,10 +628,8 @@ int size_string, ret; if (!targetcli && ((fl = dcc_isdiscouraged(sptr, realfile)))) { char *displayfile = dcc_displayfile(realfile); - sendto_one(sptr, - ":%s %d %s :*** Cannot DCC SEND file %s to %s (%s)", - me.name, RPL_TEXT, - sptr->name, displayfile, target, fl->reason); + sendnumericfmt(sptr, + RPL_TEXT, "*** Cannot DCC SEND file %s to %s (%s)", displayfile, target, fl->reason); return 0; /* block */ } return 1; /* allowed */ @@ -686,9 +682,8 @@ int size_string; if (!on_dccallow_list(to, from)) { char *displayfile = dcc_displayfile(realfile); - sendto_one(from, - ":%s %d %s :*** Cannot DCC SEND file %s to %s (%s)", - me.name, RPL_TEXT, from->name, displayfile, to->name, fl->reason); + sendnumericfmt(from, + RPL_TEXT, "*** Cannot DCC SEND file %s to %s (%s)", displayfile, to->name, fl->reason); sendnotice(from, "User %s is currently not accepting DCC SENDs with such a filename/filetype from you. " "Your file %s was not sent.", to->name, displayfile); sendnotice(to, "%s (%s@%s) tried to DCC SEND you a file named '%s', the request has been blocked.", diff --git a/src/modules/m_motd.c b/src/modules/m_motd.c index 43d8a3c37..344754d42 100644 --- a/src/modules/m_motd.c +++ b/src/modules/m_motd.c @@ -93,9 +93,7 @@ CMD_FUNC(m_motd) /* tm_year should be zero only if the struct is zero-ed */ if (themotd && themotd->lines && themotd->last_modified.tm_year) { - sendto_one(sptr, ":%s %d %s :- %d/%d/%d %d:%02d", - me.name, RPL_MOTD, sptr->name, - themotd->last_modified.tm_mday, + sendnumericfmt(sptr, RPL_MOTD, "- %d/%d/%d %d:%02d", themotd->last_modified.tm_mday, themotd->last_modified.tm_mon + 1, themotd->last_modified.tm_year + 1900, themotd->last_modified.tm_hour, diff --git a/src/modules/m_oper.c b/src/modules/m_oper.c index ff4423aba..b4d9b6cbe 100644 --- a/src/modules/m_oper.c +++ b/src/modules/m_oper.c @@ -189,7 +189,7 @@ CMD_FUNC(m_oper) /* Check oper::require_modes */ if (operblock->require_modes & ~sptr->umodes) { - sendto_one(sptr, ":%s %d %s :You are missing user modes required to OPER", me.name, ERR_NOOPERHOST, sptr->name); + sendnumericfmt(sptr, ERR_NOOPERHOST, "You are missing user modes required to OPER"); sendto_snomask_global (SNO_OPER, "Failed OPER attempt by %s (%s@%s) [lacking modes '%s' in oper::require-modes]", sptr->name, sptr->user->username, sptr->local->sockhost, get_modestr(operblock->require_modes & ~sptr->umodes)); diff --git a/src/parse.c b/src/parse.c index 502a99b4e..4d341e498 100644 --- a/src/parse.c +++ b/src/parse.c @@ -390,8 +390,7 @@ int parse2(aClient *cptr, aClient **fromptr, MessageTag *mtags, char *ch, char * ** of notices -- Syzop. */ if (!IsRegistered(cptr) && stricmp(ch, "NOTICE")) { - sendto_one(from, ":%s %d %s :You have not registered", - me.name, ERR_NOTREGISTERED, ch); + sendnumericfmt(from, ERR_NOTREGISTERED, "You have not registered"); parse_addlag(cptr, bytes); return -1; } diff --git a/src/s_err.c b/src/s_err.c index 6dcf360c9..c1b475cf1 100644 --- a/src/s_err.c +++ b/src/s_err.c @@ -509,7 +509,7 @@ static char *replies[] = { /* 462 ERR_ALREADYREGISTRED */ ":You may not reregister", /* 463 ERR_NOPERMFORHOST */ ":Your host isn't among the privileged", /* 464 ERR_PASSWDMISMATCH */ ":Password Incorrect", -/* 465 ERR_YOUREBANNEDCREEP */ ":You are banned from this server. Mail %s for more information", +/* 465 ERR_YOUREBANNEDCREEP */ ":%s", /* 466 */ NULL, /* rfc1459 */ /* 467 ERR_KEYSET */ "%s :Channel key already set", /* 468 ERR_ONLYSERVERSCANCHANGE */ "%s :Only servers can change that mode", diff --git a/src/s_extra.c b/src/s_extra.c index 2007e4316..f93b82d7b 100644 --- a/src/s_extra.c +++ b/src/s_extra.c @@ -224,8 +224,7 @@ int found = 0; } if (!found) { - sendto_one(sptr, ":%s %d %s :%s is not in your DCC allow list", - me.name, RPL_DCCINFO, sptr->name, optr->name); + sendnumericfmt(sptr, RPL_DCCINFO, "%s is not in your DCC allow list", optr->name); return 0; } diff --git a/src/s_misc.c b/src/s_misc.c index 48a8bfe59..9d15b321a 100644 --- a/src/s_misc.c +++ b/src/s_misc.c @@ -1203,10 +1203,7 @@ int banned_client(aClient *acptr, char *bantype, char *reason, int global, int n */ if (noexit != NO_EXIT_CLIENT) { - sendto_one(acptr,":%s %d %s :%s", - me.name, ERR_YOUREBANNEDCREEP, - (*acptr->name ? acptr->name : "*"), - buf); + sendnumeric(acptr, ERR_YOUREBANNEDCREEP, buf); sendnotice(acptr, "%s", buf); } else { send_raw_direct(acptr, ":%s %d %s :%s", diff --git a/src/s_serv.c b/src/s_serv.c index 7b0524834..68f216804 100644 --- a/src/s_serv.c +++ b/src/s_serv.c @@ -280,38 +280,26 @@ void m_info_send(aClient *sptr) { char **text = unrealinfo; - sendto_one(sptr, ":%s %d %s :========== %s ==========", - me.name, RPL_INFO, sptr->name, IRCDTOTALVERSION); + sendnumericfmt(sptr, RPL_INFO, "========== %s ==========", IRCDTOTALVERSION); while (*text) - sendto_one(sptr, ":%s %d %s :| %s", - me.name, RPL_INFO, sptr->name, *text++); + sendnumericfmt(sptr, RPL_INFO, "| %s", *text++); - sendto_one(sptr, ":%s %d %s :|", me.name, RPL_INFO, sptr->name); - sendto_one(sptr, ":%s %d %s :|", me.name, RPL_INFO, sptr->name); - sendto_one(sptr, ":%s %d %s :| Credits - Type /Credits", - me.name, RPL_INFO, sptr->name); - sendto_one(sptr, ":%s %d %s :| DALnet Credits - Type /DalInfo", - me.name, RPL_INFO, sptr->name); - sendto_one(sptr, ":%s %d %s :|", me.name, RPL_INFO, sptr->name); - sendto_one(sptr, ":%s %d %s :| This is an UnrealIRCd-style server", - me.name, RPL_INFO, sptr->name); - sendto_one(sptr, ":%s %d %s :| If you find any bugs, please report them at:", - me.name, RPL_INFO, sptr->name); - sendto_one(sptr, ":%s %d %s :| https://bugs.unrealircd.org/", - me.name, RPL_INFO, sptr->name); - sendto_one(sptr, - ":%s %d %s :| UnrealIRCd Homepage: https://www.unrealircd.org", - me.name, RPL_INFO, sptr->name); - sendto_one(sptr, - ":%s %d %s :============================================", me.name, - RPL_INFO, sptr->name); - sendto_one(sptr, ":%s %d %s :Birth Date: %s, compile # %s", me.name, - RPL_INFO, sptr->name, creation, generation); - sendto_one(sptr, ":%s %d %s :On-line since %s", me.name, RPL_INFO, - sptr->name, myctime(me.local->firsttime)); - sendto_one(sptr, ":%s %d %s :ReleaseID (%s)", me.name, RPL_INFO, - sptr->name, buildid); + sendnumericfmt(sptr, RPL_INFO, "|"); + sendnumericfmt(sptr, RPL_INFO, "|"); + sendnumericfmt(sptr, RPL_INFO, "| Credits - Type /Credits"); + sendnumericfmt(sptr, RPL_INFO, "| DALnet Credits - Type /DalInfo"); + sendnumericfmt(sptr, RPL_INFO, "|"); + sendnumericfmt(sptr, RPL_INFO, "| This is an UnrealIRCd-style server"); + sendnumericfmt(sptr, RPL_INFO, "| If you find any bugs, please report them at:"); + sendnumericfmt(sptr, RPL_INFO, "| https://bugs.unrealircd.org/"); + sendnumericfmt(sptr, + RPL_INFO, "| UnrealIRCd Homepage: https://www.unrealircd.org"); + sendnumericfmt(sptr, + RPL_INFO, "============================================"); + sendnumericfmt(sptr, RPL_INFO, "Birth Date: %s, compile # %s", creation, generation); + sendnumericfmt(sptr, RPL_INFO, "On-line since %s", myctime(me.local->firsttime)); + sendnumericfmt(sptr, RPL_INFO, "ReleaseID (%s)", buildid); sendnumeric(sptr, RPL_ENDOFINFO); } @@ -351,11 +339,9 @@ CMD_FUNC(m_dalinfo) sendnumeric(sptr, RPL_INFO, *text++); sendnumeric(sptr, RPL_INFO, ""); - sendto_one(sptr, - ":%s %d %s :Birth Date: %s, compile # %s", - me.name, RPL_INFO, sptr->name, creation, generation); - sendto_one(sptr, ":%s %d %s :On-line since %s", - me.name, RPL_INFO, sptr->name, myctime(me.local->firsttime)); + sendnumericfmt(sptr, + RPL_INFO, "Birth Date: %s, compile # %s", creation, generation); + sendnumericfmt(sptr, RPL_INFO, "On-line since %s", myctime(me.local->firsttime)); sendnumeric(sptr, RPL_ENDOFINFO); } @@ -402,11 +388,9 @@ CMD_FUNC(m_credits) sendnumeric(sptr, RPL_INFO, *text++); sendnumeric(sptr, RPL_INFO, ""); - sendto_one(sptr, - ":%s %d %s :Birth Date: %s, compile # %s", - me.name, RPL_INFO, sptr->name, creation, generation); - sendto_one(sptr, ":%s %d %s :On-line since %s", - me.name, RPL_INFO, sptr->name, myctime(me.local->firsttime)); + sendnumericfmt(sptr, + RPL_INFO, "Birth Date: %s, compile # %s", creation, generation); + sendnumericfmt(sptr, RPL_INFO, "On-line since %s", myctime(me.local->firsttime)); sendnumeric(sptr, RPL_ENDOFINFO); } @@ -899,16 +883,13 @@ int short_motd(aClient *sptr) if (themotd->last_modified.tm_year) { tm = &themotd->last_modified; /* for readability */ - sendnumeric(sptr, RPL_MOTDSTART, - me.name); - sendto_one(sptr, ":%s %d %s :- %d/%d/%d %d:%02d", me.name, - RPL_MOTD, sptr->name, tm->tm_mday, tm->tm_mon + 1, + sendnumeric(sptr, RPL_MOTDSTART, me.name); + sendnumericfmt(sptr, RPL_MOTD, "- %d/%d/%d %d:%02d", tm->tm_mday, tm->tm_mon + 1, 1900 + tm->tm_year, tm->tm_hour, tm->tm_min); } if (is_short) { - sendnumeric(sptr, RPL_MOTD, - "This is the short MOTD. To view the complete MOTD type /motd"); + sendnumeric(sptr, RPL_MOTD, "This is the short MOTD. To view the complete MOTD type /motd"); sendnumeric(sptr, RPL_MOTD, ""); } @@ -917,8 +898,7 @@ int short_motd(aClient *sptr) motdline = themotd->lines; while (motdline) { - sendnumeric(sptr, RPL_MOTD, - motdline->line); + sendnumeric(sptr, RPL_MOTD, motdline->line); motdline = motdline->next; } sendnumeric(sptr, RPL_ENDOFMOTD);