summaryrefslogtreecommitdiff
path: root/src/users.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/users.cpp')
-rw-r--r--src/users.cpp28
1 files changed, 20 insertions, 8 deletions
diff --git a/src/users.cpp b/src/users.cpp
index 09a8c37a5..27eb0a1f6 100644
--- a/src/users.cpp
+++ b/src/users.cpp
@@ -92,10 +92,11 @@ bool DoneClassesAndTypes(ServerConfig* conf, const char* tag)
return true;
}
-bool userrec::ProcessNoticeMasks(const char *sm)
+std::string userrec::ProcessNoticeMasks(const char *sm)
{
- bool adding = true;
+ bool adding = true, oldadding = false;
const char *c = sm;
+ std::string output = "";
while (c && *c)
{
@@ -103,20 +104,31 @@ bool userrec::ProcessNoticeMasks(const char *sm)
{
case '+':
adding = true;
- break;
+ break;
case '-':
adding = false;
- break;
+ break;
default:
- if ((*c >= 'A') && (*c <= 'z'))
- this->SetNoticeMask(*c, adding);
- break;
+ if ((*c >= 'A') && (*c <= 'z') && (ServerInstance->SNO->IsEnabled(*c)))
+ {
+ if ((IsNoticeMaskSet(*c) && adding) || (!IsNoticeMaskSet(*c) && !adding))
+ {
+ if ((oldadding != adding) || (sm == c))
+ output += (adding ? '+' : '-');
+
+ this->SetNoticeMask(*c, adding);
+
+ output += *c;
+ }
+ }
+ oldadding = adding;
+ break;
}
*c++;
}
- return true;
+ return output;
}
void userrec::StartDNSLookup()