diff options
| author | 2010-02-25 11:39:45 -0600 | |
|---|---|---|
| committer | 2010-08-03 17:32:37 -0400 | |
| commit | 42fa295245924cf6c0b0e35a5cd2fe5a70f9346e (patch) | |
| tree | 8198d7377d9e65628a511ff01fb1cd20d42962b3 /src/users.cpp | |
| parent | Fix /LUSERS miscounting (diff) | |
Make remote/local snomasks consistent and allow use without naming
Diffstat (limited to 'src/users.cpp')
| -rw-r--r-- | src/users.cpp | 19 |
1 files changed, 15 insertions, 4 deletions
diff --git a/src/users.cpp b/src/users.cpp index a73b0629d..f08c94d75 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)) { |
