changeset 5709:0c9606770db1

mod_audit: Also record human-readable name of country Nicer to show in graphs but less machine-usable Throw in continent in case that turns out to be useful one day
author Kim Alvefur <zash@zash.se>
date Mon, 13 Nov 2023 12:22:17 +0100
parents 37ba9478b387
children 15c1801e8901
files mod_audit/mod_audit.lua
diffstat 1 files changed, 2 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/mod_audit/mod_audit.lua	Mon Nov 13 12:14:31 2023 +0100
+++ b/mod_audit/mod_audit.lua	Mon Nov 13 12:22:17 2023 +0100
@@ -93,8 +93,9 @@
 	end
 	if attach_location and remote_ip then
 		local geoip_info = remote_ip.proto == "IPv6" and geoip6_country:query_by_addr6(remote_ip.normal) or geoip4_country:query_by_addr(remote_ip.normal);
-		stanza:tag("location", {
+		stanza:text_tag("location", geoip_info.name, {
 			country = geoip_info.code;
+			continent = geoip_info.continent;
 		}):up();
 	end
 	if session.client_id then