summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSadie Powell <sadie@witchery.services>2021-02-22 03:10:50 +0000
committerSadie Powell <sadie@witchery.services>2021-02-22 03:10:50 +0000
commit262ad80560b168da596a2c2874f07c9fe263bf35 (patch)
tree2e9c41d7610e5f747ab3191396585ef410e4a37d
parent3204c82068de521da9d73b5a52e1bdf814fb85a4 (diff)
Add a human-readable serialiser to the geolocation extensible.
-rw-r--r--src/modules/extra/m_geo_maxmind.cpp6
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);