mod_audit/mod_audit.lua
changeset 5713 0c9606770db1
parent 5712 37ba9478b387
child 5714 15c1801e8901
equal deleted inserted replaced
5712:37ba9478b387 5713:0c9606770db1
    91 		end
    91 		end
    92 		stanza:text_tag("remote-ip", network or remote_ip.normal);
    92 		stanza:text_tag("remote-ip", network or remote_ip.normal);
    93 	end
    93 	end
    94 	if attach_location and remote_ip then
    94 	if attach_location and remote_ip then
    95 		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);
    95 		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);
    96 		stanza:tag("location", {
    96 		stanza:text_tag("location", geoip_info.name, {
    97 			country = geoip_info.code;
    97 			country = geoip_info.code;
       
    98 			continent = geoip_info.continent;
    98 		}):up();
    99 		}):up();
    99 	end
   100 	end
   100 	if session.client_id then
   101 	if session.client_id then
   101 		stanza:text_tag("client", session.client_id);
   102 		stanza:text_tag("client", session.client_id);
   102 	end
   103 	end