diff options
author | Sadie Powell <sadie@witchery.services> | 2021-02-22 03:10:50 +0000 |
---|---|---|
committer | Sadie Powell <sadie@witchery.services> | 2021-02-22 03:10:50 +0000 |
commit | 262ad80560b168da596a2c2874f07c9fe263bf35 (patch) | |
tree | 2e9c41d7610e5f747ab3191396585ef410e4a37d /src | |
parent | 3204c82068de521da9d73b5a52e1bdf814fb85a4 (diff) |
Add a human-readable serialiser to the geolocation extensible.
Diffstat (limited to 'src')
-rw-r--r-- | src/modules/extra/m_geo_maxmind.cpp | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/src/modules/extra/m_geo_maxmind.cpp b/src/modules/extra/m_geo_maxmind.cpp index 2850e0501..6f5d4ef20 100644 --- a/src/modules/extra/m_geo_maxmind.cpp +++ b/src/modules/extra/m_geo_maxmind.cpp @@ -43,6 +43,12 @@ class GeolocationExtItem : public ExtensionItem { } + std::string ToHuman(const Extensible* container, void* item) const CXX11_OVERRIDE + { + Geolocation::Location* location = static_cast<Geolocation::Location*>(item); + return location->GetName() + " [" + location->GetCode() + "]"; + } + void free(Extensible* container, void* item) CXX11_OVERRIDE { Geolocation::Location* old = static_cast<Geolocation::Location*>(item); |