]> git.netwichtig.de Git - user/henk/code/inspircd.git/blobdiff - src/modules/m_channames.cpp
cmd_quit Display quit messages of remote users
[user/henk/code/inspircd.git] / src / modules / m_channames.cpp
index aed3ec2269f8d3f29d25958c7e1cac02917fdd8a..a9ef6729ea7a0cb5a8ab1a30bc7afa6abc897862 100644 (file)
@@ -24,8 +24,6 @@ static std::bitset<256> allowedmap;
 class NewIsChannelHandler : public HandlerBase1<bool, const std::string&>
 {
  public:
-       NewIsChannelHandler() { }
-       ~NewIsChannelHandler() { }
        bool Call(const std::string&);
 };
 
@@ -62,9 +60,6 @@ class ModuleChannelNames : public Module
        void init() CXX11_OVERRIDE
        {
                ServerInstance->IsChannel = &myhandler;
-               Implementation eventlist[] = { I_OnRehash, I_OnUserKick };
-               ServerInstance->Modules->Attach(eventlist, this, sizeof(eventlist)/sizeof(Implementation));
-               OnRehash(NULL);
        }
 
        void ValidateChans()
@@ -84,7 +79,7 @@ class ModuleChannelNames : public Module
                        {
                                std::vector<std::string> modes;
                                modes.push_back(c->name);
-                               modes.push_back("-" + permchannelmode->GetModeChar());
+                               modes.push_back(std::string("-") + permchannelmode->GetModeChar());
 
                                ServerInstance->Modes->Process(modes, ServerInstance->FakeClient);
                        }
@@ -104,11 +99,17 @@ class ModuleChannelNames : public Module
                badchan = false;
        }
 
-       void OnRehash(User* user) CXX11_OVERRIDE
+       void ReadConfig(ConfigStatus& status) CXX11_OVERRIDE
        {
                ConfigTag* tag = ServerInstance->Config->ConfValue("channames");
                std::string denyToken = tag->getString("denyrange");
                std::string allowToken = tag->getString("allowrange");
+
+               if (!denyToken.compare(0, 2, "0-"))
+                       denyToken[0] = '1';
+               if (!allowToken.compare(0, 2, "0-"))
+                       allowToken[0] = '1';
+
                allowedmap.set();
 
                irc::portparser denyrange(denyToken, false);