diff options
| author | 2025-03-19 17:15:54 +0000 | |
|---|---|---|
| committer | 2025-03-19 17:15:54 +0000 | |
| commit | b71bee4006dfed684f4c2ee86e3766056f33a6e8 (patch) | |
| tree | 3ac4920566e49a2ff0d1cf2ab9c0706b855b4717 /modules | |
| parent | Allow using signals to rehash any module instead of just TLS. (diff) | |
Allow reloading the geolocation database with a module rehash.
Diffstat (limited to 'modules')
| -rw-r--r-- | modules/extra/geo_maxmind.cpp | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/modules/extra/geo_maxmind.cpp b/modules/extra/geo_maxmind.cpp index fd8dc12d0..7e2580f4d 100644 --- a/modules/extra/geo_maxmind.cpp +++ b/modules/extra/geo_maxmind.cpp @@ -219,6 +219,23 @@ public: // up again next time it is requested. geoapi.ext.Unset(user); } + + void OnModuleRehash(User* user, const std::string& param) override + { + if (!irc::equals(param, "geolocation")) + return; + + try + { + ConfigStatus status; + this->ReadConfig(status); + ServerInstance->SNO.WriteToSnoMask('r', "MaxMind database has been reloaded."); + } + catch (const ModuleException& ex) + { + ServerInstance->SNO.WriteToSnoMask('r', "Failed to reload the MaxMind database. " + ex.GetReason()); + } + } }; MODULE_INIT(ModuleGeoMaxMind) |
