Software /
code /
prosody-modules
Comparison
mod_ipcheck/mod_ipcheck.lua @ 1945:e5039f14e2a7
mod_ipcheck: Fixed bad namespace
author | Goffi <goffi@goffi.org> |
---|---|
date | Sun, 08 Nov 2015 13:46:46 +0100 |
parent | 1245:a1287d1f8a1f |
child | 3269:b0628bc93acf |
comparison
equal
deleted
inserted
replaced
1944:1950fa6aa0c0 | 1945:e5039f14e2a7 |
---|---|
27 local origin, stanza = event.origin, event.stanza; | 27 local origin, stanza = event.origin, event.stanza; |
28 if stanza.attr.type == "get" then | 28 if stanza.attr.type == "get" then |
29 if stanza.attr.to then | 29 if stanza.attr.to then |
30 origin.send(st.error_reply(stanza, "auth", "forbidden", "You can only ask about your own IP address")); | 30 origin.send(st.error_reply(stanza, "auth", "forbidden", "You can only ask about your own IP address")); |
31 elseif origin.ip then | 31 elseif origin.ip then |
32 local reply = st.reply(stanza):tag("address", {xmlns='urn:xmpp:sic:0'}) | 32 local reply = st.reply(stanza):tag("address", {xmlns='urn:xmpp:sic:1'}) |
33 :tag("ip"):text(origin.ip):up() | 33 :tag("ip"):text(origin.ip):up() |
34 if origin.conn and origin.conn.port then -- server_event | 34 if origin.conn and origin.conn.port then -- server_event |
35 reply:tag("port"):text(tostring(origin.conn:port())) | 35 reply:tag("port"):text(tostring(origin.conn:port())) |
36 elseif origin.conn and origin.conn.clientport then -- server_select | 36 elseif origin.conn and origin.conn.clientport then -- server_select |
37 reply:tag("port"):text(tostring(origin.conn:clientport())) | 37 reply:tag("port"):text(tostring(origin.conn:clientport())) |