From 3813f2870c99ebf70a4f2d8bcd3a74770bb1a4ed Mon Sep 17 00:00:00 2001 From: Sadie Powell Date: Thu, 5 Mar 2026 13:00:56 +0000 Subject: Convert the shun and rline modules to use standard replies. --- modules/shun.cpp | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) (limited to 'modules/shun.cpp') diff --git a/modules/shun.cpp b/modules/shun.cpp index 875996083..ffdfdb7ea 100644 --- a/modules/shun.cpp +++ b/modules/shun.cpp @@ -30,6 +30,7 @@ #include "inspircd.h" +#include "modules/ircv3.h" #include "modules/shun.h" #include "modules/stats.h" #include "timeutils.h" @@ -58,9 +59,13 @@ public: class CommandShun final : public Command { +private: + IRCv3::ReplyCapReference stdrplcap; + public: CommandShun(Module* Creator) : Command(Creator, "SHUN", 1, 3) + , stdrplcap(Creator) { accepts_multiple_targets = true; access_needed = CmdAccess::OPERATOR; @@ -94,7 +99,8 @@ public: } else { - user->WriteNotice("*** Shun " + parameters[0] + " not found on the list."); + IRCv3::WriteReply(Reply::Type::FAIL, user, stdrplcap, this, "NOT_FOUND", parameters[0], + FMT::format("{} not found on the shun list.", parameters[0])); return CmdResult::FAILURE; } } @@ -107,7 +113,8 @@ public: { if (!Duration::TryFrom(parameters[1], duration)) { - user->WriteNotice("*** Invalid duration for SHUN."); + IRCv3::WriteReply(Reply::Type::FAIL, user, stdrplcap, this, "INVALID_DURATION", parameters[1], + FMT::format("Invalid duration for shun: {}.", parameters[1])); return CmdResult::FAILURE; } expr = parameters[2]; @@ -136,7 +143,8 @@ public: else { delete r; - user->WriteNotice("*** Shun for " + target + " already exists."); + IRCv3::WriteReply(Reply::Type::FAIL, user, stdrplcap, this, "ALREADY_EXISTS", parameters[0], + FMT::format("Shun on {} already exists.", parameters[0])); return CmdResult::FAILURE; } } -- cgit v1.3.1-10-gc9f91