]> git.netwichtig.de Git - user/henk/code/inspircd.git/blobdiff - src/modules/m_permchannels.cpp
Introduce "X" snomask for remote *:line messages [patch by jackmcbarn]
[user/henk/code/inspircd.git] / src / modules / m_permchannels.cpp
index 3317b5c0894364dddca737c1fbc8f8dd8b2c9fb1..e27b2cf9c4239152e3a9be63d36035148e10bf1a 100644 (file)
@@ -17,7 +17,7 @@
 
 // Not in a class due to circular dependancy hell.
 static std::string permchannelsconf;
-static bool WriteDatabase(InspIRCd *ServerInstance)
+static bool WriteDatabase()
 {
        FILE *f;
 
@@ -61,7 +61,7 @@ static bool WriteDatabase(InspIRCd *ServerInstance)
        if (write_error)
        {
                ServerInstance->Logs->Log("m_permchannels",DEFAULT, "permchannels: Cannot write to new database! %s (%d)", strerror(errno), errno);
-               ServerInstance->SNO->WriteToSnoMask('x', "database: cannot write to new db: %s (%d)", strerror(errno), errno);
+               ServerInstance->SNO->WriteToSnoMask('a', "database: cannot write to new db: %s (%d)", strerror(errno), errno);
                return false;
        }
 
@@ -69,7 +69,7 @@ static bool WriteDatabase(InspIRCd *ServerInstance)
        if (rename(tempname.c_str(), permchannelsconf.c_str()) < 0)
        {
                ServerInstance->Logs->Log("m_permchannels",DEFAULT, "permchannels: Cannot move new to old database! %s (%d)", strerror(errno), errno);
-               ServerInstance->SNO->WriteToSnoMask('x', "database: cannot replace old with new db: %s (%d)", strerror(errno), errno);
+               ServerInstance->SNO->WriteToSnoMask('a', "database: cannot replace old with new db: %s (%d)", strerror(errno), errno);
                return false;
        }
 
@@ -83,7 +83,7 @@ static bool WriteDatabase(InspIRCd *ServerInstance)
 class PermChannel : public ModeHandler
 {
  public:
-       PermChannel(InspIRCd* Instance, Module* Creator) : ModeHandler(Instance, Creator, 'P', 0, 0, false, MODETYPE_CHANNEL, false) { }
+       PermChannel(InspIRCd* Instance, Module* Creator) : ModeHandler(Creator, 'P', PARAM_NONE, MODETYPE_CHANNEL) { }
 
        ModeAction OnModeChange(User* source, User* dest, Channel* channel, std::string &parameter, bool adding)
        {
@@ -100,7 +100,7 @@ class PermChannel : public ModeHandler
                                channel->SetMode('P',true);
 
                                // Save permchannels db if needed.
-                               WriteDatabase(ServerInstance);
+                               WriteDatabase();
                                return MODEACTION_ALLOW;
                        }
                }
@@ -134,7 +134,7 @@ class PermChannel : public ModeHandler
                                channel->SetMode('P',false);
 
                                // Save permchannels db if needed.
-                               WriteDatabase(ServerInstance);
+                               WriteDatabase();
                                return MODEACTION_ALLOW;
                        }
                }
@@ -253,7 +253,7 @@ public:
        virtual ModResult OnRawMode(User* user, Channel* chan, const char mode, const std::string &param, bool adding, int pcnt)
        {
                if (chan && chan->IsModeSet('P'))
-                       WriteDatabase(ServerInstance);
+                       WriteDatabase();
 
                return MOD_RES_PASSTHRU;
        }
@@ -261,7 +261,7 @@ public:
        virtual void OnPostTopicChange(User*, Channel *c, const std::string&)
        {
                if (c->IsModeSet('P'))
-                       WriteDatabase(ServerInstance);
+                       WriteDatabase();
        }
 
        virtual Version GetVersion()