]> git.netwichtig.de Git - user/henk/code/inspircd.git/blobdiff - src/modules/m_shun.cpp
cgiirc: Pass hosts to WEBIRC command on rehash. No fucking wonder this never worked...
[user/henk/code/inspircd.git] / src / modules / m_shun.cpp
index ab7e30c58d5c2de83db1b0e0862ac8a1c2ec2b30..939807bd3f663ee8253cf0e21be16dbb7d51f184 100644 (file)
@@ -32,7 +32,11 @@ public:
 
        bool Matches(User *u)
        {
-               if (InspIRCd::Match(u->GetFullHost(), matchtext) || InspIRCd::Match(u->GetFullRealHost(), matchtext))
+               // E: overrides shun
+               if (u->exempt)
+                       return false;
+
+               if (InspIRCd::Match(u->GetFullHost(), matchtext) || InspIRCd::Match(u->GetFullRealHost(), matchtext) || InspIRCd::Match(u->nick+"!"+u->ident+"@"+u->GetIPString(), matchtext))
                        return true;
 
                return false;
@@ -93,6 +97,10 @@ class CommandShun : public Command
                /* 'time' is a human-readable timestring, like 2d3h2s. */
 
                std::string target = parameters[0];
+               
+               User *find = ServerInstance->FindNick(target.c_str());
+               if (find)
+                       target = std::string("*!*@") + find->GetIPString();
 
                if (parameters.size() == 1)
                {
@@ -110,10 +118,6 @@ class CommandShun : public Command
                }
                else if (parameters.size() >= 2)
                {
-                       User* find = ServerInstance->FindNick(target.c_str());
-                       if (find)
-                               target = std::string("*!*@") + find->GetIPString();
-
                        // Adding - XXX todo make this respect <insane> tag perhaps..
                        long duration;
                        std::string expr;
@@ -187,7 +191,7 @@ class ModuleShun : public Module
 
                Implementation eventlist[] = { I_OnStats, I_OnPreCommand, I_OnUserConnect, I_OnRehash };
                ServerInstance->Modules->Attach(eventlist, this, 4);
-               OnRehash(NULL, "");
+               OnRehash(NULL);
        }
 
        virtual ~ModuleShun()
@@ -205,7 +209,7 @@ class ModuleShun : public Module
                return 1;
        }
 
-       virtual void OnRehash(User* user, const std::string &parameter)
+       virtual void OnRehash(User* user)
        {
                ConfigReader MyConf(ServerInstance);
                std::string cmds = MyConf.ReadValue("shun", "enabledcommands", 0);