summaryrefslogtreecommitdiff
path: root/modules/commands/os_forbid.cpp
diff options
context:
space:
mode:
authorAdam <Adam@anope.org>2012-02-22 18:12:02 -0500
committerAdam <Adam@anope.org>2012-02-22 18:12:02 -0500
commit3850b073ddf610415de54dced9ff134397779676 (patch)
treec1a464fba432a7a79535fac4c05cc46f8f19901e /modules/commands/os_forbid.cpp
parent81e50dd1f404c9bad008fe1b569dad134df91125 (diff)
Added regex support for many commands, such as akill, sqline, snline,
all of the */list commands, etc. Also extended the ability of akill to match a full nick!user@host and real name of users.
Diffstat (limited to 'modules/commands/os_forbid.cpp')
-rw-r--r--modules/commands/os_forbid.cpp15
1 files changed, 12 insertions, 3 deletions
diff --git a/modules/commands/os_forbid.cpp b/modules/commands/os_forbid.cpp
index 908e2f2ca..d305de3c6 100644
--- a/modules/commands/os_forbid.cpp
+++ b/modules/commands/os_forbid.cpp
@@ -41,7 +41,7 @@ class MyForbidService : public ForbidService
{
ForbidData *d = this->forbidData[i - 1];
- if ((ftype == FT_NONE || ftype == d->type) && Anope::Match(mask, d->mask))
+ if ((ftype == FT_NONE || ftype == d->type) && Anope::Match(mask, d->mask, false, true))
return d;
}
return NULL;
@@ -217,6 +217,10 @@ class CommandOSForbid : public Command
source.Reply(" ");
source.Reply(_("Forbid allows you to forbid usage of certain nicknames, channels,\n"
"and email addresses. Wildcards are accepted for all entries."));
+ if (!Config->RegexEngine.empty())
+ source.Reply(" \n"
+ "Regex matches are also supported using the %s engine.\n"
+ "Enclose your pattern in // if this desired.", Config->RegexEngine.c_str());
return true;
}
};
@@ -273,8 +277,13 @@ class OSForbid : public Module
BotInfo *bi = findbot(Config->OperServ);
ForbidData *d = this->forbidService.FindForbid(c->name, FT_CHAN);
if (bi != NULL && d != NULL)
- {
- if (!c->HasFlag(CH_INHABIT))
+ {
+ if (ircd->chansqline)
+ {
+ XLine x(c->name, bi->nick, Anope::CurTime + Config->CSInhabit, d->reason);
+ ircdproto->SendSQLine(NULL, &x);
+ }
+ else if (!c->HasFlag(CH_INHABIT))
{
/* Join ChanServ and set a timer for this channel to part ChanServ later */
c->Hold();