X-Git-Url: https://git.netwichtig.de/gitweb/?a=blobdiff_plain;f=src%2Fmodules%2Fm_permchannels.cpp;h=74a798356c1a67b8cf05aac577932d9d0afbb11e;hb=a5d110282a864fd2e91b51ce360a977cd0643657;hp=0a7dc8ed96b9b2d551fa03cac6b528da4531b50a;hpb=4d41afdc2ecf36017154e7a460457c076c8aaa16;p=user%2Fhenk%2Fcode%2Finspircd.git diff --git a/src/modules/m_permchannels.cpp b/src/modules/m_permchannels.cpp index 0a7dc8ed9..74a798356 100644 --- a/src/modules/m_permchannels.cpp +++ b/src/modules/m_permchannels.cpp @@ -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) { } @@ -301,6 +298,12 @@ public: ServerInstance->Logs->Log("m_permchannels", DEBUG, "Added %s with topic %s", channel.c_str(), topic.c_str()); + if (modes.find('P') == std::string::npos) + { + ServerInstance->Logs->Log("m_permchannels", DEFAULT, "%s (%s) does not have +P set in ; it will be deleted when empty!", + c->name.c_str(), tag->getTagLocation().c_str()); + } + if (modes.empty()) continue; @@ -356,8 +359,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;