1
0
mirror of https://github.com/anope/anope.git synced 2026-07-08 16:43:13 +02:00

Only matches sqlines against channels if they begin with a #

This commit is contained in:
Adam
2015-03-11 14:49:03 -04:00
parent bf727285bc
commit 92920f5a1c
2 changed files with 12 additions and 3 deletions
+3 -1
View File
@@ -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"
+9 -2
View File
@@ -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;
}