summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/modules/extra/m_geoip.cpp9
1 files changed, 8 insertions, 1 deletions
diff --git a/src/modules/extra/m_geoip.cpp b/src/modules/extra/m_geoip.cpp
index a36c39bc8..03b7a55f7 100644
--- a/src/modules/extra/m_geoip.cpp
+++ b/src/modules/extra/m_geoip.cpp
@@ -58,7 +58,7 @@ class ModuleGeoIP : public Module
throw ModuleException("Unable to initialize geoip, are you missing GeoIP.dat?");
ServerInstance->Modules->AddService(ext);
- Implementation eventlist[] = { I_OnSetConnectClass, I_OnStats };
+ Implementation eventlist[] = { I_OnSetConnectClass, I_OnSetUserIP, I_OnStats };
ServerInstance->Modules->Attach(eventlist, this, sizeof(eventlist)/sizeof(Implementation));
for (LocalUserList::const_iterator i = ServerInstance->Users->local_users.begin(); i != ServerInstance->Users->local_users.end(); ++i)
@@ -99,6 +99,13 @@ class ModuleGeoIP : public Module
return MOD_RES_DENY;
}
+ void OnSetUserIP(LocalUser* user)
+ {
+ // If user has sent NICK/USER, re-set the ExtItem as this is likely CGI:IRC changing the IP
+ if (user->registered == REG_NICKUSER)
+ SetExt(user);
+ }
+
ModResult OnStats(char symbol, User* user, string_list &out)
{
if (symbol != 'G')