diff options
| author | 2009-10-21 23:45:19 +0000 | |
|---|---|---|
| committer | 2009-10-21 23:45:19 +0000 | |
| commit | 123eac3f25ce4dd3142b4ac66eb321f7df1e23e4 (patch) | |
| tree | 7503b5ce313dc18edc4b39dd0e580ba6ea7fc930 /src/modules/extra/m_geoip.cpp | |
| parent | Move some local-only fields to LocalUser (diff) | |
Change module API to use LocalUser* where correct
git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@11943 e03df62e-2008-0410-955e-edbf42e46eb7
Diffstat (limited to 'src/modules/extra/m_geoip.cpp')
| -rw-r--r-- | src/modules/extra/m_geoip.cpp | 26 |
1 files changed, 11 insertions, 15 deletions
diff --git a/src/modules/extra/m_geoip.cpp b/src/modules/extra/m_geoip.cpp index ff6e3c7c2..d2d8f93f8 100644 --- a/src/modules/extra/m_geoip.cpp +++ b/src/modules/extra/m_geoip.cpp @@ -62,23 +62,19 @@ class ModuleGeoIP : public Module } } - virtual ModResult OnUserRegister(User* user) + virtual ModResult OnUserRegister(LocalUser* user) { - /* only do lookups on local users */ - if (IS_LOCAL(user)) + const char* c = GeoIP_country_code_by_addr(gi, user->GetIPString()); + if (c) { - const char* c = GeoIP_country_code_by_addr(gi, user->GetIPString()); - if (c) - { - std::map<std::string, std::string>::iterator x = GeoBans.find(c); - if (x != GeoBans.end()) - ServerInstance->Users->QuitUser(user, x->second); - } - else - { - if (banunknown) - ServerInstance->Users->QuitUser(user, "Could not identify your country of origin. Access denied."); - } + std::map<std::string, std::string>::iterator x = GeoBans.find(c); + if (x != GeoBans.end()) + ServerInstance->Users->QuitUser(user, x->second); + } + else + { + if (banunknown) + ServerInstance->Users->QuitUser(user, "Could not identify your country of origin. Access denied."); } return MOD_RES_PASSTHRU; } |
