From 8c0426116cdf09e807da12b6b23d977c4a073119 Mon Sep 17 00:00:00 2001 From: Peter Powell Date: Sat, 7 Apr 2018 15:14:53 +0100 Subject: Fix some more oversights in m_geoip. - 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 | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) (limited to 'src/modules/extra') diff --git a/src/modules/extra/m_geoip.cpp b/src/modules/extra/m_geoip.cpp index 4b11e3df0..35efc8d70 100644 --- a/src/modules/extra/m_geoip.cpp +++ b/src/modules/extra/m_geoip.cpp @@ -95,7 +95,7 @@ class ModuleGeoIP : public Module, public Whois::EventListener GeoIP_delete(gi); } - void ReadConfig(ConfigStatus&) + void ReadConfig(ConfigStatus&) CXX11_OVERRIDE { 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); } - ModResult OnCheckBan(User *user, Channel *c, const std::string& mask) + void On005Numeric(std::map& 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] == ':')) { -- cgit v1.2.3