From 92920f5a1c8866c8e26e1608f0feb3e3e54c8dd2 Mon Sep 17 00:00:00 2001 From: Adam Date: Wed, 11 Mar 2015 14:49:03 -0400 Subject: [PATCH] Only matches sqlines against channels if they begin with a # --- modules/commands/os_sxline.cpp | 4 +++- modules/pseudoclients/operserv.cpp | 11 +++++++++-- 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::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; }