diff options
author | Michael <michaelhazell@hotmail.com> | 2020-10-20 02:14:33 -0400 |
---|---|---|
committer | Sadie Powell <sadie@witchery.services> | 2020-10-24 22:59:51 +0100 |
commit | f6d30f8fef02e9571628bd3cc6519c2b897ff496 (patch) | |
tree | e3793c732c3b5c555c6aac7e47b77c355084c79a | |
parent | 4c801a70be6ec095797689bf2240ec875ba840c7 (diff) |
m_cban: Implement support for channel masks
Allows wildcards to be used
-rw-r--r-- | docs/conf/helpop.conf.example | 6 | ||||
-rw-r--r-- | src/modules/m_cban.cpp | 5 |
2 files changed, 6 insertions, 5 deletions
diff --git a/docs/conf/helpop.conf.example b/docs/conf/helpop.conf.example index 792efcd9c..4805ae790 100644 --- a/docs/conf/helpop.conf.example +++ b/docs/conf/helpop.conf.example @@ -572,9 +572,9 @@ the network. Sends a message to all users with the +g snomask. "> -<helpop key="cban" title="/CBAN <channel> [<duration> [:<reason>]]" value=" -Sets or removes a global channel ban. You must specify all three parameters -to add a ban, and one parameter to remove a ban (just the channel). +<helpop key="cban" title="/CBAN <channelmask> [<duration> [:<reason>]]" value=" +Sets or removes a global channel based ban. You must specify all three parameters +to add a ban, and one parameter to remove a ban (just the channelmask). The duration may be specified in seconds, or in the format 1y2w3d4h5m6s - meaning one year, two weeks, three days, four hours, diff --git a/src/modules/m_cban.cpp b/src/modules/m_cban.cpp index 43f53668e..dee844320 100644 --- a/src/modules/m_cban.cpp +++ b/src/modules/m_cban.cpp @@ -58,7 +58,7 @@ public: bool Matches(const std::string& s) CXX11_OVERRIDE { - return irc::equals(matchtext, s); + return InspIRCd::Match(s, matchtext); } const std::string& Displayable() CXX11_OVERRIDE @@ -94,7 +94,8 @@ class CommandCBan : public Command public: CommandCBan(Module* Creator) : Command(Creator, "CBAN", 1, 3) { - flags_needed = 'o'; this->syntax = "<channel> [<duration> [:<reason>]]"; + flags_needed = 'o'; + this->syntax = "<channelmask> [<duration> [:<reason>]]"; } CmdResult Handle(User* user, const Params& parameters) CXX11_OVERRIDE |