]> git.netwichtig.de Git - user/henk/code/inspircd.git/blobdiff - src/modules/m_blockamsg.cpp
m_override now has a 'requirekey' option, that requires a special key of 'override...
[user/henk/code/inspircd.git] / src / modules / m_blockamsg.cpp
index 4e02a84c00febe519ce2a0a51b3bef882d16ebf4..e4a4eaf4ec556b1ad8df1d31c7ba443b6d7485ad 100644 (file)
@@ -2,7 +2,7 @@
  *       | Inspire Internet Relay Chat Daemon |
  *       +------------------------------------+
  *
- *  InspIRCd: (C) 2002-2007 InspIRCd Development Team
+ *  InspIRCd: (C) 2002-2008 InspIRCd Development Team
  * See: http://www.inspircd.org/wiki/index.php/Credits
  *
  * This program is free but copyrighted software; see
@@ -44,10 +44,8 @@ class ModuleBlockAmsg : public Module
        BlockAction action;
        
  public:
-       ModuleBlockAmsg(InspIRCd* Me)
-       : Module(Me)
+       ModuleBlockAmsg(InspIRCd* Me) : Module(Me)
        {
-               
                this->OnRehash(NULL,"");
                Implementation eventlist[] = { I_OnRehash, I_OnPreCommand, I_OnCleanup };
                ServerInstance->Modules->Attach(eventlist, this, 3);
@@ -60,7 +58,7 @@ class ModuleBlockAmsg : public Module
        
        virtual Version GetVersion()
        {
-               return Version(1,1,0,0,VF_VENDOR,API_VERSION);
+               return Version(1,2,0,0,VF_VENDOR,API_VERSION);
        }
        
        virtual void OnRehash(User* user, const std::string &parameter)
@@ -86,7 +84,7 @@ class ModuleBlockAmsg : public Module
                        action = IBLOCK_KILLOPERS;
        }
 
-       virtual int OnPreCommand(const std::string &command, const char** parameters, int pcnt, User *user, bool validated, const std::string &original_line)
+       virtual int OnPreCommand(const std::string &command, const char* const* parameters, int pcnt, User *user, bool validated, const std::string &original_line)
        {
                // Don't do anything with unregistered users, or remote ones.
                if(!user || (user->registered != REG_ALL) || !IS_LOCAL(user))
@@ -139,10 +137,10 @@ class ModuleBlockAmsg : public Module
                        {
                                // Block it...
                                if(action == IBLOCK_KILLOPERS || action == IBLOCK_NOTICEOPERS)
-                                       ServerInstance->WriteOpers("*** %s had an /amsg or /ame denied", user->nick);
+                                       ServerInstance->SNO->WriteToSnoMask('A', "%s had an /amsg or /ame denied", user->nick);
 
                                if(action == IBLOCK_KILL || action == IBLOCK_KILLOPERS)
-                                       User::QuitUser(ServerInstance, user, "Global message (/amsg or /ame) detected");
+                                       ServerInstance->Users->QuitUser(user, "Global message (/amsg or /ame) detected");
                                else if(action == IBLOCK_NOTICE || action == IBLOCK_NOTICEOPERS)
                                        user->WriteServ( "NOTICE %s :Global message (/amsg or /ame) detected", user->nick);