]> git.netwichtig.de Git - user/henk/code/inspircd.git/blobdiff - src/modules/m_permchannels.cpp
Change allocation of UserManager::clientlist to be physically part of the object...
[user/henk/code/inspircd.git] / src / modules / m_permchannels.cpp
index edb752f671d633f340c61c2bc452e6f04c9940c8..d23af04bcc53b22a56d6f8fe4646a94ffda4fccd 100644 (file)
@@ -74,7 +74,8 @@ static bool WriteDatabase(PermChannel& permchanmode, Module* mod, bool save_list
        stream << "# This file is automatically generated by m_permchannels. Any changes will be overwritten." << std::endl
                << "<config format=\"xml\">" << std::endl;
 
-       for (chan_hash::const_iterator i = ServerInstance->chanlist->begin(); i != ServerInstance->chanlist->end(); i++)
+       const chan_hash& chans = ServerInstance->GetChans();
+       for (chan_hash::const_iterator i = chans.begin(); i != chans.end(); ++i)
        {
                Channel* chan = i->second;
                if (!chan->IsModeSet(permchanmode))
@@ -174,37 +175,14 @@ public:
        {
        }
 
-       CullResult cull()
-       {
-               /*
-                * DelMode can't remove the +P mode on empty channels, or it will break
-                * merging modes with remote servers. Remove the empty channels now as
-                * we know this is not the case.
-                */
-               chan_hash::iterator iter = ServerInstance->chanlist->begin();
-               while (iter != ServerInstance->chanlist->end())
-               {
-                       Channel* c = iter->second;
-                       if (c->GetUserCounter() == 0)
-                       {
-                               chan_hash::iterator at = iter;
-                               iter++;
-                               FOREACH_MOD(OnChannelDelete, (c));
-                               ServerInstance->chanlist->erase(at);
-                               ServerInstance->GlobalCulls.AddItem(c);
-                       }
-                       else
-                               iter++;
-               }
-               ServerInstance->Modes->DelMode(&p);
-               return Module::cull();
-       }
-
        void ReadConfig(ConfigStatus& status) CXX11_OVERRIDE
        {
                ConfigTag* tag = ServerInstance->Config->ConfValue("permchanneldb");
                permchannelsconf = tag->getString("filename");
                save_listmodes = tag->getBool("listmodes");
+
+               if (!permchannelsconf.empty())
+                       permchannelsconf = ServerInstance->Config->Paths.PrependConfig(permchannelsconf);
        }
 
        void LoadDatabase()