summaryrefslogtreecommitdiff
path: root/modules/pseudoclients/operserv.cpp
diff options
context:
space:
mode:
authorAdam <Adam@anope.org>2013-05-08 11:30:05 -0400
committerAdam <Adam@anope.org>2013-05-08 11:31:20 -0400
commit912103ec13b712c692f6fecba56d6f08975220f9 (patch)
tree5e0a403d1a74140181d1970554e26537351a8d47 /modules/pseudoclients/operserv.cpp
parentf843e7bd9032923bd231bc83536a89d32e59d857 (diff)
Allow using sxlines on ircds that do not support them, since we always enforce them anyway
Diffstat (limited to 'modules/pseudoclients/operserv.cpp')
-rw-r--r--modules/pseudoclients/operserv.cpp25
1 files changed, 20 insertions, 5 deletions
diff --git a/modules/pseudoclients/operserv.cpp b/modules/pseudoclients/operserv.cpp
index a451813ef..c514536fa 100644
--- a/modules/pseudoclients/operserv.cpp
+++ b/modules/pseudoclients/operserv.cpp
@@ -100,12 +100,20 @@ class SQLineManager : public XLineManager
return Anope::Match(u->nick, x->mask);
}
- bool CheckChannel(Channel *c)
+ XLine *CheckChannel(Channel *c)
{
for (std::vector<XLine *>::const_iterator it = this->GetList().begin(), it_end = this->GetList().end(); it != it_end; ++it)
- if (Anope::Match(c->name, (*it)->mask, false, true))
- return true;
- return false;
+ {
+ XLine *x = *it;
+ if (x->regex)
+ {
+ if (x->regex->Matches(c->name))
+ return x;
+ }
+ else if (Anope::Match(c->name, x->mask, false, true))
+ return x;
+ }
+ return NULL;
}
};
@@ -238,7 +246,14 @@ class OperServCore : public Module
EventReturn OnCheckKick(User *u, ChannelInfo *ci, Anope::string &mask, Anope::string &reason) anope_override
{
- return this->sqlines.CheckChannel(ci->c) ? EVENT_STOP : EVENT_CONTINUE;
+ XLine *x = this->sqlines.CheckChannel(ci->c);
+ if (x)
+ {
+ this->sqlines.OnMatch(u, x);
+ return EVENT_STOP;
+ }
+
+ return EVENT_CONTINUE;
}
EventReturn OnPreHelp(CommandSource &source, const std::vector<Anope::string> &params) anope_override