X-Git-Url: https://git.netwichtig.de/gitweb/?a=blobdiff_plain;f=src%2Fusers.cpp;h=81f83058387fc544245ec01bbb1d4395c9da344c;hb=61197974c5f7ce009096468b208c3abf2c25810b;hp=0f6cba2da7135c7d79a557e6a961c656c3dbf3ed;hpb=1acecec2792dc20260546a27be079db4818e9491;p=user%2Fhenk%2Fcode%2Finspircd.git diff --git a/src/users.cpp b/src/users.cpp index 0f6cba2da..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)) { @@ -719,7 +730,7 @@ void LocalUser::CheckClass() } else if (a->type == CC_DENY) { - ServerInstance->Users->QuitUser(this, "Unauthorised connection"); + ServerInstance->Users->QuitUser(this, a->config->getString("reason", "Unauthorised connection")); return; } else if ((a->GetMaxLocal()) && (ServerInstance->Users->LocalCloneCount(this) > a->GetMaxLocal()))