X-Git-Url: https://git.netwichtig.de/gitweb/?a=blobdiff_plain;f=src%2Fmodules%2Fm_permchannels.cpp;h=b12b9bbebcdf43e47fee14666ea7607961454ef6;hb=47332d6e9b990498dd35457090dd8983d8aae8d3;hp=8958cdfcd67199dd7cd01d3be3aad8ba4d920523;hpb=84a1569cd60daa64b1ae52a1fff62c0dc4d78850;p=user%2Fhenk%2Fcode%2Finspircd.git diff --git a/src/modules/m_permchannels.cpp b/src/modules/m_permchannels.cpp index 8958cdfcd..b12b9bbeb 100644 --- a/src/modules/m_permchannels.cpp +++ b/src/modules/m_permchannels.cpp @@ -172,6 +172,14 @@ public: ServerInstance->Modules->Attach(eventlist, this, sizeof(eventlist)/sizeof(Implementation)); OnRehash(NULL); + + // Load only when there are no linked servers - we set the TS of the channels we + // create to the current time, this can lead to desync because spanningtree has + // no way of knowing what we do + ProtoServerList serverlist; + ServerInstance->PI->GetServerList(serverlist); + if (serverlist.size() < 2) + LoadDatabase(); } CullResult cull() @@ -201,14 +209,16 @@ public: } virtual void OnRehash(User *user) + { + permchannelsconf = ServerInstance->Config->ConfValue("permchanneldb")->getString("filename"); + } + + void LoadDatabase() { /* * Process config-defined list of permanent channels. * -- w00t */ - - permchannelsconf = ServerInstance->Config->ConfValue("permchanneldb")->getString("filename"); - ConfigTagList permchannels = ServerInstance->Config->ConfTags("permchannels"); for (ConfigIter i = permchannels.first; i != permchannels.second; ++i) { @@ -219,7 +229,7 @@ public: if (channel.empty()) { - ServerInstance->Logs->Log("blah", DEBUG, "Malformed permchannels tag with empty channel name."); + ServerInstance->Logs->Log("m_permchannels", DEBUG, "Malformed permchannels tag with empty channel name."); continue; } @@ -240,7 +250,7 @@ public: */ c->topicset = 42; } - ServerInstance->Logs->Log("blah", DEBUG, "Added %s with topic %s", channel.c_str(), topic.c_str()); + ServerInstance->Logs->Log("m_permchannels", DEBUG, "Added %s with topic %s", channel.c_str(), topic.c_str()); if (modes.empty()) continue;