]> git.netwichtig.de Git - user/henk/code/inspircd.git/blobdiff - src/modules/m_filter.cpp
Weed out a few leftover server instances from before modules had ServerInstance....
[user/henk/code/inspircd.git] / src / modules / m_filter.cpp
index cff996c643f1145fdf8f59f7db5f9577aed54fde..bb99ffa601db730f9c806548a914349add679b28 100644 (file)
@@ -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")
                {