]> git.netwichtig.de Git - user/henk/code/inspircd.git/blobdiff - src/modules/m_permchannels.cpp
Switch <stdint.h> test to use a test file too.
[user/henk/code/inspircd.git] / src / modules / m_permchannels.cpp
index 04171585bf5f090e2e9b2601eaad0aa05e4de299..e86b3cbf6d171dece2453c8e50e110680ad9c980 100644 (file)
@@ -156,12 +156,7 @@ static bool WriteDatabase(Module* mod, bool save_listmodes)
        }
 
 #ifdef _WIN32
-       if (remove(permchannelsconf.c_str()))
-       {
-               ServerInstance->Logs->Log("m_permchannels",DEFAULT, "permchannels: Cannot remove old database! %s (%d)", strerror(errno), errno);
-               ServerInstance->SNO->WriteToSnoMask('a', "database: cannot remove old database: %s (%d)", strerror(errno), errno);
-               return false;
-       }
+       remove(permchannelsconf.c_str());
 #endif
        // Use rename to move temporary to new db - this is guarenteed not to fuck up, even in case of a crash.
        if (rename(tempname.c_str(), permchannelsconf.c_str()) < 0)
@@ -214,10 +209,12 @@ class ModulePermanentChannels : public Module
 {
        PermChannel p;
        bool dirty;
+       bool loaded;
        bool save_listmodes;
 public:
 
-       ModulePermanentChannels() : p(this), dirty(false)
+       ModulePermanentChannels()
+               : p(this), dirty(false), loaded(false)
        {
        }
 
@@ -292,6 +289,8 @@ public:
 
                                c->SetTopic(NULL, topic, true);
                                c->setby = tag->getString("topicsetby");
+                               if (c->setby.empty())
+                                       c->setby = ServerInstance->Config->ServerName;
                                unsigned int topicset = tag->getInt("topicts");
                                // SetTopic() sets the topic TS to now, if there was no topicts saved then don't overwrite that with a 0
                                if (topicset > 0)
@@ -354,8 +353,6 @@ public:
                // to be able to set the modes they provide (e.g.: m_stripcolor is inited after us)
                // Prioritize() is called after all module initialization is complete, consequently
                // all modes are available now
-
-               static bool loaded = false;
                if (loaded)
                        return;