aboutsummaryrefslogtreecommitdiffstats
path: root/modules/shun.cpp
diff options
context:
space:
mode:
authorGravatar Sadie Powell2026-03-05 13:00:56 +0000
committerGravatar Sadie Powell2026-03-05 15:36:08 +0000
commit3813f2870c99ebf70a4f2d8bcd3a74770bb1a4ed (patch)
tree1d89c5a0cb278036669c80c87461f274f5a4479c /modules/shun.cpp
parentConvert the cban module to use standard replies. (diff)
Convert the shun and rline modules to use standard replies.
Diffstat (limited to 'modules/shun.cpp')
-rw-r--r--modules/shun.cpp14
1 files changed, 11 insertions, 3 deletions
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;
}
}