From d95be0a5165cf3cee3d1feedab1bdbdf21e5e419 Mon Sep 17 00:00:00 2001 From: Sadie Powell Date: Sun, 18 Aug 2024 16:04:36 +0100 Subject: Add a formatting overload to {Membership,User}::Write(Remote)Notice. --- src/modules/m_dnsbl.cpp | 6 +++--- src/modules/m_gateway.cpp | 10 +++++----- src/modules/m_messageflood.cpp | 2 +- src/modules/m_remove.cpp | 4 ++-- src/modules/m_satopic.cpp | 2 +- src/modules/m_securelist.cpp | 4 ++-- src/modules/m_showwhois.cpp | 2 +- src/modules/m_spanningtree/main.cpp | 8 ++++---- src/modules/m_spanningtree/rconnect.cpp | 2 +- src/modules/m_spanningtree/rsquit.cpp | 4 ++-- src/modules/m_sslinfo.cpp | 14 +++++++------- src/modules/m_tline.cpp | 6 +++--- 12 files changed, 32 insertions(+), 32 deletions(-) (limited to 'src/modules') diff --git a/src/modules/m_dnsbl.cpp b/src/modules/m_dnsbl.cpp index 2864d93d9..737ed2c62 100644 --- a/src/modules/m_dnsbl.cpp +++ b/src/modules/m_dnsbl.cpp @@ -500,13 +500,13 @@ public: if (count) { // TODO: replace this with a FAIL stdrpl when we can network those. - user->WriteRemoteNotice(INSP_FORMAT("*** DNSBL: Unable to recheck {}: still waiting on {} DNSBLs from the previous check.", - ltarget->nick, count)); + user->WriteRemoteNotice("*** DNSBL: Unable to recheck {}: still waiting on {} DNSBLs from the previous check.", + ltarget->nick, count); return CmdResult::FAILURE; } // TODO: replace this with a NOTE stdrpl when we can network those. - user->WriteRemoteNotice(INSP_FORMAT("*** DNSBL: Rechecking {} against {} DNSBLs.", ltarget->nick, data.dnsbls.size())); + user->WriteRemoteNotice("*** DNSBL: Rechecking {} against {} DNSBLs.", ltarget->nick, data.dnsbls.size()); const bool has_reason = parameters.size() > 1; ServerInstance->SNO.WriteGlobalSno('d', "{} is rechecking whether {} ({}) is in a DNSBL{}{}", user->nick, diff --git a/src/modules/m_gateway.cpp b/src/modules/m_gateway.cpp index c223254cc..8631b91a5 100644 --- a/src/modules/m_gateway.cpp +++ b/src/modules/m_gateway.cpp @@ -164,20 +164,20 @@ public: } uint32_t addr = sa.in4.sin_addr.s_addr; - user->WriteNotice(INSP_FORMAT("*** HEXIP: {} encodes to {:02x}{:02x}{:02x}{:02x}.", + user->WriteNotice("*** HEXIP: {} encodes to {:02x}{:02x}{:02x}{:02x}.", sa.addr(), (addr & 0xFF), ((addr >> 8) & 0xFF), ((addr >> 16) & 0xFF), - ((addr >> 24) & 0xFF))); + ((addr >> 24) & 0xFF)); return CmdResult::SUCCESS; } if (ParseIP(parameters[0], sa)) { - user->WriteNotice(INSP_FORMAT("*** HEXIP: {} decodes to {}.", parameters[0], sa.addr())); + user->WriteNotice("*** HEXIP: {} decodes to {}.", parameters[0], sa.addr()); return CmdResult::SUCCESS; } - user->WriteNotice(INSP_FORMAT("*** HEXIP: {} is not a valid raw or hex encoded IPv4 address.", - parameters[0])); + user->WriteNotice("*** HEXIP: {} is not a valid raw or hex encoded IPv4 address.", + parameters[0]); return CmdResult::FAILURE; } diff --git a/src/modules/m_messageflood.cpp b/src/modules/m_messageflood.cpp index 8a7bdff4f..d511dea36 100644 --- a/src/modules/m_messageflood.cpp +++ b/src/modules/m_messageflood.cpp @@ -246,7 +246,7 @@ private: if (memb) memb->WriteNotice(message); else - user->WriteNotice(INSP_FORMAT("[{}] {}", chan->name, message)); + user->WriteNotice("[{}] {}", chan->name, message); } public: diff --git a/src/modules/m_remove.cpp b/src/modules/m_remove.cpp index a418e6625..9646873b5 100644 --- a/src/modules/m_remove.cpp +++ b/src/modules/m_remove.cpp @@ -82,7 +82,7 @@ public: if (!channel->HasUser(target)) { - user->WriteNotice(INSP_FORMAT("*** User {} is not on channel {}", target->nick, channel->name)); + user->WriteNotice("*** User {} is not on channel {}", target->nick, channel->name); return CmdResult::FAILURE; } @@ -135,7 +135,7 @@ public: } else { - user->WriteNotice(INSP_FORMAT("*** You do not have access to /REMOVE {} from {}", target->nick, channel->name)); + user->WriteNotice("*** You do not have access to /REMOVE {} from {}", target->nick, channel->name); return CmdResult::FAILURE; } } diff --git a/src/modules/m_satopic.cpp b/src/modules/m_satopic.cpp index 7f019e831..1046d0157 100644 --- a/src/modules/m_satopic.cpp +++ b/src/modules/m_satopic.cpp @@ -51,7 +51,7 @@ public: const std::string newTopic(parameters[1], 0, ServerInstance->Config->Limits.MaxTopic); if (target->topic == newTopic) { - user->WriteNotice(INSP_FORMAT("The topic on {} is already what you are trying to change it to.", target->name)); + user->WriteNotice("The topic on {} is already what ou are trying to change it to.", target->name); return CmdResult::SUCCESS; } diff --git a/src/modules/m_securelist.cpp b/src/modules/m_securelist.cpp index 7e3df7261..2c8c3d6eb 100644 --- a/src/modules/m_securelist.cpp +++ b/src/modules/m_securelist.cpp @@ -120,9 +120,9 @@ public: { if (waittime) { - user->WriteNotice(INSP_FORMAT("*** You cannot view the channel list right now. Please {}try again in {}.", + user->WriteNotice("*** You cannot view the channel list right now. Please {}try again in {}.", exemptregistered ? "log in to an account or " : "", - Duration::ToString(maxwaittime - ServerInstance->Time()))); + Duration::ToString(maxwaittime - ServerInstance->Time())); } else { diff --git a/src/modules/m_showwhois.cpp b/src/modules/m_showwhois.cpp index b54691aa6..7216c8b13 100644 --- a/src/modules/m_showwhois.cpp +++ b/src/modules/m_showwhois.cpp @@ -57,7 +57,7 @@ public: const std::string& userhost = dest->HasPrivPermission("users/auspex") ? src->GetRealUserHost() : src->GetUserHost(); - dest->WriteNotice(INSP_FORMAT("{} ({}) did a /WHOIS on you", src->nick, userhost)); + dest->WriteNotice("{} ({}) did a /WHOIS on you", src->nick, userhost); } CmdResult Handle(User* user, const Params& parameters) override diff --git a/src/modules/m_spanningtree/main.cpp b/src/modules/m_spanningtree/main.cpp index 37a1b36d6..c1e74d4c4 100644 --- a/src/modules/m_spanningtree/main.cpp +++ b/src/modules/m_spanningtree/main.cpp @@ -351,25 +351,25 @@ ModResult ModuleSpanningTree::HandleConnect(const CommandBase::Params& parameter { if (InspIRCd::Match(ServerInstance->Config->ServerName, x->Name, ascii_case_insensitive_map)) { - user->WriteRemoteNotice(INSP_FORMAT("*** CONNECT: Server \002{}\002 is ME, not connecting.", x->Name)); + user->WriteRemoteNotice("*** CONNECT: Server \002{}\002 is ME, not connecting.", x->Name); return MOD_RES_DENY; } TreeServer* CheckDupe = Utils->FindServer(x->Name); if (!CheckDupe) { - user->WriteRemoteNotice(INSP_FORMAT("*** CONNECT: Connecting to server: \002{}\002 ({}:{})", x->Name, (x->HiddenFromStats ? "" : x->IPAddr), x->Port)); + user->WriteRemoteNotice("*** CONNECT: Connecting to server: \002{}\002 ({}:{})", x->Name, (x->HiddenFromStats ? "" : x->IPAddr), x->Port); ConnectServer(x); return MOD_RES_DENY; } else { - user->WriteRemoteNotice(INSP_FORMAT("*** CONNECT: Server \002{}\002 already exists on the network and is connected via \002{}\002", x->Name, CheckDupe->GetParent()->GetName())); + user->WriteRemoteNotice("*** CONNECT: Server \002{}\002 already exists on the network and is connected via \002{}\002", x->Name, CheckDupe->GetParent()->GetName()); return MOD_RES_DENY; } } } - user->WriteRemoteNotice(INSP_FORMAT("*** CONNECT: No server matching \002{}\002 could be found in the config file.", parameters[0])); + user->WriteRemoteNotice("*** CONNECT: No server matching \002{}\002 could be found in the config file.", parameters[0]); return MOD_RES_DENY; } diff --git a/src/modules/m_spanningtree/rconnect.cpp b/src/modules/m_spanningtree/rconnect.cpp index 784a96be5..f79ed8d17 100644 --- a/src/modules/m_spanningtree/rconnect.cpp +++ b/src/modules/m_spanningtree/rconnect.cpp @@ -42,7 +42,7 @@ CmdResult CommandRConnect::Handle(User* user, const Params& parameters) /* First see if the server which is being asked to connect to another server in fact exists */ if (!Utils->FindServerMask(parameters[0])) { - user->WriteRemoteNotice(INSP_FORMAT("*** RCONNECT: Server \002{}\002 isn't connected to the network!", parameters[0])); + user->WriteRemoteNotice("*** RCONNECT: Server \002{}\002 isn't connected to the network!", parameters[0]); return CmdResult::FAILURE; } diff --git a/src/modules/m_spanningtree/rsquit.cpp b/src/modules/m_spanningtree/rsquit.cpp index 7026a9674..97155957c 100644 --- a/src/modules/m_spanningtree/rsquit.cpp +++ b/src/modules/m_spanningtree/rsquit.cpp @@ -44,13 +44,13 @@ CmdResult CommandRSQuit::Handle(User* user, const Params& parameters) server_target = Utils->FindServerMask(parameters[0]); if (!server_target) { - user->WriteRemoteNotice(INSP_FORMAT("*** RSQUIT: Server \002{}\002 isn't connected to the network!", parameters[0])); + user->WriteRemoteNotice("*** RSQUIT: Server \002{}\002 isn't connected to the network!", parameters[0]); return CmdResult::FAILURE; } if (server_target->IsRoot()) { - user->WriteRemoteNotice(INSP_FORMAT("*** RSQUIT: Foolish mortal, you cannot make a server SQUIT itself! ({} matches local server name)", parameters[0])); + user->WriteRemoteNotice("*** RSQUIT: Foolish mortal, you cannot make a server SQUIT itself! ({} matches local server name)", parameters[0]); return CmdResult::FAILURE; } diff --git a/src/modules/m_sslinfo.cpp b/src/modules/m_sslinfo.cpp index 5141aa7a4..b2d148cb5 100644 --- a/src/modules/m_sslinfo.cpp +++ b/src/modules/m_sslinfo.cpp @@ -199,17 +199,17 @@ private: ssl_cert* cert = sslapi.GetCertificate(target); if (!cert) { - source->WriteNotice(INSP_FORMAT("*** {} is not connected using TLS.", target->nick)); + source->WriteNotice("*** {} is not connected using TLS.", target->nick); } else if (cert->GetError().length()) { - source->WriteNotice(INSP_FORMAT("*** {} is connected using TLS but has not specified a valid client certificate ({}).", - target->nick, cert->GetError())); + source->WriteNotice("*** {} is connected using TLS but has not specified a valid client certificate ({}).", + target->nick, cert->GetError()); } else if (!verbose) { - source->WriteNotice(INSP_FORMAT("*** {} is connected using TLS with a valid client certificate ({}).", - target->nick, cert->GetFingerprint())); + source->WriteNotice("*** {} is connected using TLS with a valid client certificate ({}).", + target->nick, cert->GetFingerprint()); } else { @@ -262,9 +262,9 @@ private: if (sslonlymode) { - source->WriteNotice(INSP_FORMAT("*** {} {} have channel mode +{} ({}) set.", + source->WriteNotice("*** {} {} have channel mode +{} ({}) set.", chan->name, chan->IsModeSet(sslonlymode) ? "does" : "does not", - sslonlymode->GetModeChar(), sslonlymode->name)); + sslonlymode->GetModeChar(), sslonlymode->name); } for (const auto& [u, _] : chan->GetUsers()) diff --git a/src/modules/m_tline.cpp b/src/modules/m_tline.cpp index adcbfd8cb..8b0fbf675 100644 --- a/src/modules/m_tline.cpp +++ b/src/modules/m_tline.cpp @@ -62,11 +62,11 @@ public: if (n_matched) { float p = (n_matched / (float)n_counted) * 100; - user->WriteNotice(INSP_FORMAT("*** TLINE: Counted {} user(s). Matched '{}' against {} user(s) ({:0.2}% of the userbase). {} by hostname and {} by IP address.", - n_counted, parameters[0], n_matched, p, n_match_host, n_match_ip)); + user->WriteNotice("*** TLINE: Counted {} user(s). Matched '{}' against {} user(s) ({:0.2}% of the userbase). {} by hostname and {} by IP address.", + n_counted, parameters[0], n_matched, p, n_match_host, n_match_ip); } else - user->WriteNotice(INSP_FORMAT("*** TLINE: Counted {} user(s). Matched '{}' against no user(s).", n_counted, parameters[0])); + user->WriteNotice("*** TLINE: Counted {} user(s). Matched '{}' against no user(s).", n_counted, parameters[0]); return CmdResult::SUCCESS; } -- cgit v1.3.1-10-gc9f91