summaryrefslogtreecommitdiff
path: root/src/users.cpp
diff options
context:
space:
mode:
authordanieldg <danieldg@e03df62e-2008-0410-955e-edbf42e46eb7>2010-02-25 19:42:08 +0000
committerdanieldg <danieldg@e03df62e-2008-0410-955e-edbf42e46eb7>2010-02-25 19:42:08 +0000
commit61197974c5f7ce009096468b208c3abf2c25810b (patch)
tree9a7cf7a895941d1d734093a3bbc7f9c27f6e734c /src/users.cpp
parent52a42b48cd63bd49991130f9cf7f2b0e13c76448 (diff)
Make remote/local snomasks consistent and allow use without naming
git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@12568 e03df62e-2008-0410-955e-edbf42e46eb7
Diffstat (limited to 'src/users.cpp')
-rw-r--r--src/users.cpp19
1 files changed, 15 insertions, 4 deletions
diff --git a/src/users.cpp b/src/users.cpp
index f69d34fea..81f830583 100644
--- a/src/users.cpp
+++ b/src/users.cpp
@@ -37,9 +37,9 @@ std::string User::ProcessNoticeMasks(const char *sm)
adding = false;
break;
case '*':
- for (unsigned char d = 'A'; d <= 'z'; d++)
+ for (unsigned char d = 'a'; d <= 'z'; d++)
{
- if (ServerInstance->SNO->IsEnabled(d))
+ if (!ServerInstance->SNO->masks[d - 'a'].Description.empty())
{
if ((!IsNoticeMaskSet(d) && adding) || (IsNoticeMaskSet(d) && !adding))
{
@@ -50,12 +50,23 @@ std::string User::ProcessNoticeMasks(const char *sm)
output += d;
}
+ oldadding = adding;
+ char u = toupper(d);
+ if ((!IsNoticeMaskSet(u) && adding) || (IsNoticeMaskSet(u) && !adding))
+ {
+ if ((oldadding != adding) || (!output.length()))
+ output += (adding ? '+' : '-');
+
+ this->SetNoticeMask(u, adding);
+
+ output += u;
+ }
+ oldadding = adding;
}
- oldadding = adding;
}
break;
default:
- if ((*c >= 'A') && (*c <= 'z') && (ServerInstance->SNO->IsEnabled(*c)))
+ if (isalpha(*c))
{
if ((!IsNoticeMaskSet(*c) && adding) || (IsNoticeMaskSet(*c) && !adding))
{