X-Git-Url: https://git.netwichtig.de/gitweb/?a=blobdiff_plain;f=src%2Fmodules%2Fm_permchannels.cpp;h=b8e5ea5e81802f5dee9dbfa0a1c75fb8ff266906;hb=67de413cad88194972d55a8ff88464370890c5a9;hp=cfb4fef275d45586abb0bce326f4cf5ec22f2396;hpb=c286b42418c3d7614225b1226632a25ac513994b;p=user%2Fhenk%2Fcode%2Finspircd.git diff --git a/src/modules/m_permchannels.cpp b/src/modules/m_permchannels.cpp index cfb4fef27..b8e5ea5e8 100644 --- a/src/modules/m_permchannels.cpp +++ b/src/modules/m_permchannels.cpp @@ -21,8 +21,6 @@ #include "inspircd.h" #include -/* $ModDesc: Provides support for channel mode +P to provide permanent channels */ - /** Handles the +P channel mode */ @@ -66,7 +64,7 @@ static bool WriteDatabase(PermChannel& permchanmode) std::ofstream stream(permchannelsnewconf.c_str()); if (!stream.is_open()) { - ServerInstance->Logs->Log("m_permchannels", LOG_DEFAULT, "permchannels: Cannot create database! %s (%d)", strerror(errno), errno); + ServerInstance->Logs->Log(MODNAME, LOG_DEFAULT, "Cannot create database! %s (%d)", strerror(errno), errno); ServerInstance->SNO->WriteToSnoMask('a', "database: cannot create new db: %s (%d)", strerror(errno), errno); return false; } @@ -88,7 +86,7 @@ static bool WriteDatabase(PermChannel& permchanmode) if (stream.fail()) { - ServerInstance->Logs->Log("m_permchannels", LOG_DEFAULT, "permchannels: Cannot write to new database! %s (%d)", strerror(errno), errno); + ServerInstance->Logs->Log(MODNAME, LOG_DEFAULT, "Cannot write to new database! %s (%d)", strerror(errno), errno); ServerInstance->SNO->WriteToSnoMask('a', "database: cannot write to new db: %s (%d)", strerror(errno), errno); return false; } @@ -97,7 +95,7 @@ static bool WriteDatabase(PermChannel& permchanmode) #ifdef _WIN32 if (remove(permchannelsconf.c_str())) { - ServerInstance->Logs->Log("m_permchannels", LOG_DEFAULT, "permchannels: Cannot remove old database! %s (%d)", strerror(errno), errno); + ServerInstance->Logs->Log(MODNAME, LOG_DEFAULT, "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; } @@ -105,7 +103,7 @@ static bool WriteDatabase(PermChannel& permchanmode) // Use rename to move temporary to new db - this is guarenteed not to fuck up, even in case of a crash. if (rename(permchannelsnewconf.c_str(), permchannelsconf.c_str()) < 0) { - ServerInstance->Logs->Log("m_permchannels", LOG_DEFAULT, "permchannels: Cannot move new to old database! %s (%d)", strerror(errno), errno); + ServerInstance->Logs->Log(MODNAME, LOG_DEFAULT, "Cannot move new to old database! %s (%d)", strerror(errno), errno); ServerInstance->SNO->WriteToSnoMask('a', "database: cannot replace old with new db: %s (%d)", strerror(errno), errno); return false; } @@ -126,8 +124,6 @@ public: void init() CXX11_OVERRIDE { ServerInstance->Modules->AddService(p); - Implementation eventlist[] = { I_OnChannelPreDelete, I_OnPostTopicChange, I_OnRawMode, I_OnRehash, I_OnBackgroundTimer }; - ServerInstance->Modules->Attach(eventlist, this, sizeof(eventlist)/sizeof(Implementation)); OnRehash(NULL); } @@ -147,7 +143,7 @@ public: { chan_hash::iterator at = iter; iter++; - FOREACH_MOD(I_OnChannelDelete, OnChannelDelete(c)); + FOREACH_MOD(OnChannelDelete, (c)); ServerInstance->chanlist->erase(at); ServerInstance->GlobalCulls.AddItem(c); } @@ -179,7 +175,7 @@ public: if (channel.empty()) { - ServerInstance->Logs->Log("m_permchannels", LOG_DEBUG, "Malformed permchannels tag with empty channel name."); + ServerInstance->Logs->Log(MODNAME, LOG_DEBUG, "Malformed permchannels tag with empty channel name."); continue; } @@ -200,7 +196,7 @@ public: */ c->topicset = 42; } - ServerInstance->Logs->Log("m_permchannels", LOG_DEBUG, "Added %s with topic %s", channel.c_str(), topic.c_str()); + ServerInstance->Logs->Log(MODNAME, LOG_DEBUG, "Added %s with topic %s", channel.c_str(), topic.c_str()); if (modes.empty()) continue; @@ -277,7 +273,7 @@ public: } catch (CoreException& e) { - ServerInstance->Logs->Log("m_permchannels", LOG_DEFAULT, "Error loading permchannels database: " + std::string(e.GetReason())); + ServerInstance->Logs->Log(MODNAME, LOG_DEFAULT, "Error loading permchannels database: " + std::string(e.GetReason())); } } }