From a34bb40da48b4750a4f0510b91ecd1cbdaf07646 Mon Sep 17 00:00:00 2001 From: Bram Matthys Date: Mon, 11 Nov 2019 11:31:42 +0100 Subject: [PATCH] Fix format of various numerics that use sendnumericfmt(). --- src/modules/dccallow.c | 8 ++++---- src/modules/ircops.c | 4 ++-- src/modules/oper.c | 2 +- src/parse.c | 2 +- src/serv.c | 37 +++++++++++++++++-------------------- 5 files changed, 25 insertions(+), 28 deletions(-) diff --git a/src/modules/dccallow.c b/src/modules/dccallow.c index 69013537f..ffeffd496 100644 --- a/src/modules/dccallow.c +++ b/src/modules/dccallow.c @@ -136,12 +136,12 @@ CMD_FUNC(cmd_dccallow) if (!didlist && !strncasecmp(s, "list", 4)) { didanything = didlist = 1; - sendnumericfmt(client, RPL_DCCINFO, "The following users are on your dcc allow list:"); + sendnumeric(client, RPL_DCCINFO, "The following users are on your dcc allow list:"); for(lp = client->user->dccallow; lp; lp = lp->next) { if (lp->flags == DCC_LINK_REMOTE) continue; - sendnumericfmt(client, RPL_DCCLIST, "%s (%s@%s)", lp->value.client->name, + sendnumericfmt(client, RPL_DCCLIST, ":%s (%s@%s)", lp->value.client->name, lp->value.client->user->username, GetHost(lp->value.client)); } @@ -151,7 +151,7 @@ CMD_FUNC(cmd_dccallow) { didanything = didhelp = 1; for(ptr = dcc_help; *ptr; ptr++) - sendnumericfmt(client, RPL_DCCINFO, "%s", *ptr); + sendnumeric(client, RPL_DCCINFO, *ptr); sendnumeric(client, RPL_ENDOFDCCLIST, s); } } @@ -225,7 +225,7 @@ int del_dccallow(Client *client, Client *optr) } if (!found) { - sendnumericfmt(client, RPL_DCCINFO, "%s is not in your DCC allow list", optr->name); + sendnumericfmt(client, RPL_DCCINFO, ":%s is not in your DCC allow list", optr->name); return 0; } diff --git a/src/modules/ircops.c b/src/modules/ircops.c index 2e6b9c78f..352208a68 100644 --- a/src/modules/ircops.c +++ b/src/modules/ircops.c @@ -136,6 +136,6 @@ CMD_FUNC(cmd_ircops) opers, opers != 1 ? "s" : "", aways); - sendnumericfmt(client, RPL_TEXT, "%s", buf); - sendnumericfmt(client, RPL_TEXT, "End of /IRCOPS list"); + sendnumericfmt(client, RPL_TEXT, ":%s", buf); + sendnumericfmt(client, RPL_TEXT, ":End of /IRCOPS list"); } diff --git a/src/modules/oper.c b/src/modules/oper.c index 649b6bce4..2500f9009 100644 --- a/src/modules/oper.c +++ b/src/modules/oper.c @@ -184,7 +184,7 @@ CMD_FUNC(cmd_oper) /* Check oper::require_modes */ if (operblock->require_modes & ~client->umodes) { - sendnumericfmt(client, ERR_NOOPERHOST, "You are missing user modes required to OPER"); + sendnumericfmt(client, 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]", client->name, client->user->username, client->local->sockhost, get_usermode_string_raw(operblock->require_modes & ~client->umodes)); diff --git a/src/parse.c b/src/parse.c index 5a8c289bb..4dc7f9b00 100644 --- a/src/parse.c +++ b/src/parse.c @@ -387,7 +387,7 @@ static void parse2(Client *cptr, Client **fromptr, MessageTag *mtags, char *ch) */ if (!IsRegistered(cptr) && strcasecmp(ch, "NOTICE")) { - sendnumericfmt(from, ERR_NOTREGISTERED, "You have not registered"); + sendnumericfmt(from, ERR_NOTREGISTERED, ":You have not registered"); return; } /* If the user is shunned then don't send anything back in case diff --git a/src/serv.c b/src/serv.c index 22f3204c8..336b35f60 100644 --- a/src/serv.c +++ b/src/serv.c @@ -269,25 +269,23 @@ void cmd_info_send(Client *client) { char **text = unrealinfo; - sendnumericfmt(client, RPL_INFO, "========== %s ==========", IRCDTOTALVERSION); + sendnumericfmt(client, RPL_INFO, ":========== %s ==========", IRCDTOTALVERSION); while (*text) - sendnumericfmt(client, RPL_INFO, "| %s", *text++); + sendnumericfmt(client, RPL_INFO, ":| %s", *text++); - sendnumericfmt(client, RPL_INFO, "|"); - sendnumericfmt(client, RPL_INFO, "|"); - sendnumericfmt(client, RPL_INFO, "| Credits - Type /CREDITS"); - sendnumericfmt(client, RPL_INFO, "|"); - sendnumericfmt(client, RPL_INFO, "| This is an UnrealIRCd-style server"); - sendnumericfmt(client, RPL_INFO, "| If you find any bugs, please report them at:"); - sendnumericfmt(client, RPL_INFO, "| https://bugs.unrealircd.org/"); - sendnumericfmt(client, - RPL_INFO, "| UnrealIRCd Homepage: https://www.unrealircd.org"); - sendnumericfmt(client, - RPL_INFO, "============================================"); - sendnumericfmt(client, RPL_INFO, "Birth Date: %s, compile # %s", creation, generation); - sendnumericfmt(client, RPL_INFO, "On-line since %s", myctime(me.local->firsttime)); - sendnumericfmt(client, RPL_INFO, "ReleaseID (%s)", buildid); + sendnumericfmt(client, RPL_INFO, ":|"); + sendnumericfmt(client, RPL_INFO, ":|"); + sendnumericfmt(client, RPL_INFO, ":| Credits - Type /CREDITS"); + sendnumericfmt(client, RPL_INFO, ":|"); + sendnumericfmt(client, RPL_INFO, ":| This is an UnrealIRCd-style server"); + sendnumericfmt(client, RPL_INFO, ":| If you find any bugs, please report them at:"); + sendnumericfmt(client, RPL_INFO, ":| https://bugs.unrealircd.org/"); + sendnumericfmt(client, RPL_INFO, ":| UnrealIRCd Homepage: https://www.unrealircd.org"); + sendnumericfmt(client, RPL_INFO, ":============================================"); + sendnumericfmt(client, RPL_INFO, ":Birth Date: %s, compile # %s", creation, generation); + sendnumericfmt(client, RPL_INFO, ":On-line since %s", myctime(me.local->firsttime)); + sendnumericfmt(client, RPL_INFO, ":ReleaseID (%s)", buildid); sendnumeric(client, RPL_ENDOFINFO); } @@ -339,9 +337,8 @@ CMD_FUNC(cmd_credits) sendnumeric(client, RPL_INFO, *text++); sendnumeric(client, RPL_INFO, ""); - sendnumericfmt(client, - RPL_INFO, "Birth Date: %s, compile # %s", creation, generation); - sendnumericfmt(client, RPL_INFO, "On-line since %s", myctime(me.local->firsttime)); + sendnumericfmt(client, RPL_INFO, ":Birth Date: %s, compile # %s", creation, generation); + sendnumericfmt(client, RPL_INFO, ":On-line since %s", myctime(me.local->firsttime)); sendnumeric(client, RPL_ENDOFINFO); } } @@ -788,7 +785,7 @@ void short_motd(Client *client) { tm = &themotd->last_modified; /* for readability */ sendnumeric(client, RPL_MOTDSTART, me.name); - sendnumericfmt(client, RPL_MOTD, "- %d/%d/%d %d:%02d", tm->tm_mday, tm->tm_mon + 1, + sendnumericfmt(client, 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)