]> git.netwichtig.de Git - user/henk/code/inspircd.git/commitdiff
Fix some more oversights in m_geoip.
authorPeter Powell <petpow@saberuk.com>
Sat, 7 Apr 2018 14:14:53 +0000 (15:14 +0100)
committerPeter Powell <petpow@saberuk.com>
Sat, 7 Apr 2018 14:29:12 +0000 (15:29 +0100)
- Add the G: extban to the EXTBAN 005 token.
- Use CXX11_OVERRIDE with ReadConfig and OnCheckBan.

Thanks to @genius3000 for pointing these out.

src/modules/extra/m_geoip.cpp

index 4b11e3df09b41b623dcdddaf7b0f2f42506e5cdf..35efc8d70a4187ad5c80537587aeca7fbe7bd9af 100644 (file)
@@ -95,7 +95,7 @@ class ModuleGeoIP : public Module, public Whois::EventListener
                        GeoIP_delete(gi);
        }
 
                        GeoIP_delete(gi);
        }
 
-       void ReadConfig(ConfigStatus&)
+       void ReadConfig(ConfigStatus&) CXX11_OVERRIDE
        {
                ConfigTag* tag = ServerInstance->Config->ConfValue("geoip");
                extban = tag->getBool("extban");
        {
                ConfigTag* tag = ServerInstance->Config->ConfValue("geoip");
                extban = tag->getBool("extban");
@@ -106,7 +106,13 @@ class ModuleGeoIP : public Module, public Whois::EventListener
                return Version("Provides a way to assign users to connect classes by country using GeoIP lookup", VF_OPTCOMMON|VF_VENDOR);
        }
 
                return Version("Provides a way to assign users to connect classes by country using GeoIP lookup", VF_OPTCOMMON|VF_VENDOR);
        }
 
-       ModResult OnCheckBan(User *user, Channel *c, const std::string& mask)
+       void On005Numeric(std::map<std::string, std::string>& tokens) CXX11_OVERRIDE
+       {
+               if (extban)
+                       tokens["EXTBAN"].push_back('G');
+       }
+
+       ModResult OnCheckBan(User* user, Channel*, const std::string& mask) CXX11_OVERRIDE
        {
                if (extban && (mask.length() > 2) && (mask[0] == 'G') && (mask[1] == ':'))
                {
        {
                if (extban && (mask.length() > 2) && (mask[0] == 'G') && (mask[1] == ':'))
                {