]> git.netwichtig.de Git - user/henk/code/inspircd.git/blobdiff - src/modules/m_filter.cpp
[Taros] Add m_sakick.so
[user/henk/code/inspircd.git] / src / modules / m_filter.cpp
index ec5293d95107396362f9715be773993b1d9df656..60ae7e89158a081e59ae6bc22bf2c2c214ee414b 100644 (file)
@@ -133,7 +133,7 @@ class CommandFilter : public Command
        CommandFilter(FilterBase* f, InspIRCd* Me, const std::string &ssource) : Command(Me, "FILTER", "o", 1, 5), Base(f)
        {
                this->source = ssource;
-               this->syntax = "<filter-definition> <type> <flags> [<gline-duration>] :<reason>";
+               this->syntax = "<filter-definition> <action> <flags> [<gline-duration>] :<reason>";
        }
 
        CmdResult Handle(const std::vector<std::string> &parameters, User *user)
@@ -143,12 +143,13 @@ class CommandFilter : public Command
                        /* Deleting a filter */
                        if (Base->DeleteFilter(parameters[0]))
                        {
-                               user->WriteServ("NOTICE %s :*** Deleted filter '%s'", user->nick.c_str(), parameters[0].c_str());
+                               user->WriteServ("NOTICE %s :*** Removed filter '%s'", user->nick.c_str(), parameters[0].c_str());
+                               ServerInstance->SNO->WriteToSnoMask('A', std::string("FILTER: ")+user->nick+" removed filter '"+parameters[0]+"'");
                                return CMD_SUCCESS;
                        }
                        else
                        {
-                               user->WriteServ("NOTICE %s :*** Filter '%s' not found on list.", user->nick.c_str(), parameters[0].c_str());
+                               user->WriteServ("NOTICE %s :*** Filter '%s' not found in list, try /stats s.", user->nick.c_str(), parameters[0].c_str());
                                return CMD_FAILURE;
                        }
                }
@@ -179,7 +180,7 @@ class CommandFilter : public Command
                                        }
                                        else
                                        {
-                                               this->TooFewParams(user, " When setting a gline type filter, a gline duration must be specified as the third parameter.");
+                                               this->TooFewParams(user, ": When setting a gline type filter, a gline duration must be specified as the third parameter.");
                                                return CMD_FAILURE;
                                        }
                                }
@@ -191,8 +192,11 @@ class CommandFilter : public Command
                                if (result.first)
                                {
                                        user->WriteServ("NOTICE %s :*** Added filter '%s', type '%s'%s%s, flags '%s', reason: '%s'", user->nick.c_str(), freeform.c_str(),
-                                                       type.c_str(), (duration ? " duration: " : ""), (duration ? parameters[3].c_str() : ""),
+                                                       type.c_str(), (duration ? ", duration " : ""), (duration ? parameters[3].c_str() : ""),
                                                        flags.c_str(), reason.c_str());
+
+                                       ServerInstance->SNO->WriteToSnoMask('A', std::string("FILTER: ")+user->nick+" added filter '"+freeform+"', type '"+type+"', "+(duration ? "duration "+parameters[3]+", " : "")+"flags '"+flags+"', reason: "+reason);
+
                                        return CMD_SUCCESS;
                                }
                                else
@@ -277,7 +281,7 @@ int FilterBase::OnUserPreNotice(User* user,void* dest,int target_type, std::stri
                        if (i != exemptfromfilter.end()) return 0;
                }
                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);
                }
@@ -314,7 +318,7 @@ int FilterBase::OnPreCommand(std::string &command, std::vector<std::string> &par
                std::string checkline;
                int replacepoint = 0;
                bool parting = false;
-       
+
                if (command == "QUIT")
                {
                        /* QUIT with no reason: nothing to do */
@@ -344,7 +348,7 @@ int FilterBase::OnPreCommand(std::string &command, std::vector<std::string> &par
                        return 0;
 
                FilterResult* f = NULL;
-               
+
                if (flags)
                        f = this->FilterMatch(user, checkline, flags);
 
@@ -679,4 +683,3 @@ class ModuleFilter : public FilterBase
 };
 
 MODULE_INIT(ModuleFilter)
-