diff options
author | brain <brain@e03df62e-2008-0410-955e-edbf42e46eb7> | 2006-08-29 18:26:55 +0000 |
---|---|---|
committer | brain <brain@e03df62e-2008-0410-955e-edbf42e46eb7> | 2006-08-29 18:26:55 +0000 |
commit | b9e99da4dafd836e995970216835cefe3716a01a (patch) | |
tree | 3e1a53384d20e350adf6a23ac964b9429e735e6b /src/users.cpp | |
parent | e7aac9ee56d7bfff83287e3068ac18f60d43a1f9 (diff) |
Snomask support cometh! and it leave a sticky white mess all over the floor :(
git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@5062 e03df62e-2008-0410-955e-edbf42e46eb7
Diffstat (limited to 'src/users.cpp')
-rw-r--r-- | src/users.cpp | 28 |
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() |