X-Git-Url: https://git.netwichtig.de/gitweb/?a=blobdiff_plain;f=src%2Fmodules%2Fm_filter.h;h=5e74177e5073ce59ccadd902c4d1074cd518a1c7;hb=78fa4165c90088523e623ab2b64ca0db0d19def0;hp=f2986804c3fe63a67df338b7d487693faba887d8;hpb=f2acdbc3820f0f4f5ef76a0a64e73d2a320df91f;p=user%2Fhenk%2Fcode%2Finspircd.git diff --git a/src/modules/m_filter.h b/src/modules/m_filter.h index f2986804c..5e74177e5 100644 --- a/src/modules/m_filter.h +++ b/src/modules/m_filter.h @@ -15,7 +15,6 @@ enum FilterFlags { - FLAG_NOOPERS = 1, FLAG_PART = 2, FLAG_QUIT = 4, FLAG_PRIVMSG = 8, @@ -209,7 +208,7 @@ class cmd_filter : public command_t bool FilterBase::AppliesToMe(userrec* user, FilterResult* filter, int flags) { - if ((flags & FLAG_NOOPERS) && (filter->flag_no_opers) && IS_OPER(user)) + if ((filter->flag_no_opers) && IS_OPER(user)) return false; if ((flags & FLAG_PRIVMSG) && (!filter->flag_privmsg)) return false; @@ -342,7 +341,7 @@ int FilterBase::OnPreCommand(const std::string &command, const char** parameters command_t* c = ServerInstance->Parser->GetHandler(command); if (c) { - const char* params[127]; + const char* params[MAXPARAMETERS]; for (int item = 0; item < pcnt; item++) params[item] = parameters[item]; params[replacepoint] = "Reason filtered"; @@ -360,12 +359,8 @@ int FilterBase::OnPreCommand(const std::string &command, const char** parameters /* Are they parting, if so, kill is applicable */ if ((parting) && (f->action == "kill")) { - user->SetWriteError("Filtered: "+f->reason); - /* This WriteServ causes the write error to be applied. - * Its not safe to kill here with QuitUser in a PreCommand handler, - * so we do it this way, which is safe just about anywhere. - */ user->WriteServ("NOTICE %s :*** Your PART message was filtered: %s", user->nick, f->reason.c_str()); + userrec::QuitUser(ServerInstance, user, "Filtered: " + f->reason); } if (f->action == "gline") {