summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAdam <Adam@anope.org>2015-03-11 14:49:03 -0400
committerAdam <Adam@anope.org>2015-03-11 14:49:03 -0400
commit92920f5a1c8866c8e26e1608f0feb3e3e54c8dd2 (patch)
tree086d7565aa425c9a360836c3431cffd35cf2a45e
parentbf727285bcf7c7c95c2b2b43faa3d1fa13bad6fb (diff)
Only matches sqlines against channels if they begin with a #
-rw-r--r--modules/commands/os_sxline.cpp4
-rw-r--r--modules/pseudoclients/operserv.cpp11
2 files changed, 12 insertions, 3 deletions
diff --git a/modules/commands/os_sxline.cpp b/modules/commands/os_sxline.cpp
index 80b7c5586..3fde89871 100644
--- a/modules/commands/os_sxline.cpp
+++ b/modules/commands/os_sxline.cpp
@@ -664,7 +664,9 @@ class CommandOSSQLine : public CommandOSSXLineBase
"connect, Services will not allow it to pursue his IRC\n"
"session.\n"
"If the first character of the mask is #, services will\n"
- "prevent the use of matching channels."));
+ "prevent the use of matching channels. If the mask is a\n"
+ "regular expression, the expression will be matched against\n"
+ "channels too."));
source.Reply(_(" \n"
"\002SQLINE ADD\002 adds the given (nick's) mask to the SQLINE\n"
"list for the given reason (which \002must\002 be given).\n"
diff --git a/modules/pseudoclients/operserv.cpp b/modules/pseudoclients/operserv.cpp
index 67eaecd45..439c33708 100644
--- a/modules/pseudoclients/operserv.cpp
+++ b/modules/pseudoclients/operserv.cpp
@@ -117,13 +117,20 @@ class SQLineManager : public XLineManager
for (std::vector<XLine *>::const_iterator it = this->GetList().begin(), it_end = this->GetList().end(); it != it_end; ++it)
{
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;
+ else
+ {
+ if (x->mask.empty() || x->mask[0] != '#')
+ continue;
+
+ if (Anope::Match(c->name, x->mask, false, true))
+ return x;
+ }
}
return NULL;
}