X-Git-Url: https://git.netwichtig.de/gitweb/?a=blobdiff_plain;f=src%2Fmodules%2Fm_filter.cpp;h=bb99ffa601db730f9c806548a914349add679b28;hb=fcafba14c5408360ec725ed1649ede75b7ae52c1;hp=cff996c643f1145fdf8f59f7db5f9577aed54fde;hpb=b6dbd6caab62bc2c0d11ce5a45d511611eb9c2ef;p=user%2Fhenk%2Fcode%2Finspircd.git diff --git a/src/modules/m_filter.cpp b/src/modules/m_filter.cpp index cff996c64..bb99ffa60 100644 --- a/src/modules/m_filter.cpp +++ b/src/modules/m_filter.cpp @@ -167,7 +167,7 @@ class CommandFilter : public Command if ((type != "gline") && (type != "none") && (type != "block") && (type != "kill") && (type != "silent")) { - user->WriteServ("NOTICE %s :*** Invalid filter type '%s'. Supported types are 'gline', 'none', 'block', 'silent' and 'kill'.", user->nick.c_str(), freeform.c_str()); + user->WriteServ("NOTICE %s :*** Invalid filter type '%s'. Supported types are 'gline', 'none', 'block', 'silent' and 'kill'.", user->nick.c_str(), type.c_str()); return CMD_FAILURE; } @@ -283,11 +283,17 @@ int FilterBase::OnUserPreNotice(User* user,void* dest,int target_type, std::stri if (f->action == "block") { ServerInstance->SNO->WriteToSnoMask('A', std::string("FILTER: ")+user->nick+" had their message filtered, target was "+target+": "+f->reason); - user->WriteServ("NOTICE "+std::string(user->nick)+" :Your message has been filtered and opers notified: "+f->reason); + if (target_type == TYPE_CHANNEL) + user->WriteNumeric(404, "%s %s :Message to channel blocked and opers notified (%s)",user->nick.c_str(), target.c_str(), f->reason.c_str()); + else + user->WriteServ("NOTICE "+std::string(user->nick)+" :Your message to "+target+" was blocked and opers notified: "+f->reason); } if (f->action == "silent") { - user->WriteServ("NOTICE "+std::string(user->nick)+" :Your message has been filtered: "+f->reason); + if (target_type == TYPE_CHANNEL) + user->WriteNumeric(404, "%s %s :Message to channel blocked (%s)",user->nick.c_str(), target.c_str(), f->reason.c_str()); + else + user->WriteServ("NOTICE "+std::string(user->nick)+" :Your message to "+target+" was blocked: "+f->reason); } if (f->action == "kill") {