]> git.netwichtig.de Git - user/henk/code/inspircd.git/blobdiff - src/modules/m_shun.cpp
Fix merge FJOIN debug message
[user/henk/code/inspircd.git] / src / modules / m_shun.cpp
index 5527bd6ad5f312c0c49c33e6b8adaaf144d157a9..c007228e3e015f79c86b048d3d1d4af53b3523b6 100644 (file)
@@ -54,7 +54,7 @@ public:
 
        void DisplayExpiry()
        {
-               ServerInstance->SNO->WriteToSnoMask('x',"Expiring timed shun %s (set by %s %ld seconds ago)", this->matchtext.c_str(), this->source, this->duration);
+               ServerInstance->SNO->WriteToSnoMask('x',"Removing expired shun %s (set by %s %ld seconds ago)", this->matchtext.c_str(), this->source, (long int)(ServerInstance->Time() - this->set_time));
        }
 
        const char* Displayable()
@@ -160,6 +160,7 @@ class ModuleShun : public Module
        ShunFactory *f;
        std::set<std::string> ShunEnabledCommands;
        bool NotifyOfShun;
+       bool affectopers;
 
  public:
        ModuleShun(InspIRCd* Me) : Module(Me)
@@ -200,6 +201,7 @@ class ModuleShun : public Module
 
                ShunEnabledCommands.clear();
                NotifyOfShun = true;
+               affectopers = false;
 
                std::stringstream dcmds(cmds);
                std::string thiscmd;
@@ -210,6 +212,7 @@ class ModuleShun : public Module
                }
 
                NotifyOfShun = MyConf.ReadFlag("shun", "notifyuser", "yes", 0);
+               affectopers = MyConf.ReadFlag("shun", "affectopers", "no", 0);
        }
 
        virtual void OnUserConnect(User* user)
@@ -239,11 +242,18 @@ class ModuleShun : public Module
                        return 0;
                }
 
+               if (!affectopers && IS_OPER(user))
+               {
+                       /* Don't do anything if the user is an operator and affectopers isn't set */
+                       return 0;
+               }
+
                std::set<std::string>::iterator i = ShunEnabledCommands.find(command);
 
                if (i == ShunEnabledCommands.end())
                {
-                       user->WriteServ("NOTICE %s :*** Command %s not processed, as you have been blocked from issuing commands (SHUN)", user->nick.c_str(), command.c_str());
+                       if (NotifyOfShun)
+                               user->WriteServ("NOTICE %s :*** Command %s not processed, as you have been blocked from issuing commands (SHUN)", user->nick.c_str(), command.c_str());
                        return 1;
                }