Software /
code /
prosody
Comparison
plugins/mod_disco.lua @ 8002:57060d0cee4b
mod_disco: Correctly set the 'node' attr (fixes #449)
author | Kim Alvefur <zash@zash.se> |
---|---|
date | Fri, 24 Mar 2017 00:25:49 +0100 |
parent | 5081:c0c060e450be |
child | 8003:15973ade9a11 |
child | 8155:f0d847316723 |
comparison
equal
deleted
inserted
replaced
7939:6940d6db970b | 8002:57060d0cee4b |
---|---|
97 local origin, stanza = event.origin, event.stanza; | 97 local origin, stanza = event.origin, event.stanza; |
98 if stanza.attr.type ~= "get" then return; end | 98 if stanza.attr.type ~= "get" then return; end |
99 local node = stanza.tags[1].attr.node; | 99 local node = stanza.tags[1].attr.node; |
100 if node and node ~= "" and node ~= "http://prosody.im#"..get_server_caps_hash() then return; end -- TODO fire event? | 100 if node and node ~= "" and node ~= "http://prosody.im#"..get_server_caps_hash() then return; end -- TODO fire event? |
101 local reply_query = get_server_disco_info(); | 101 local reply_query = get_server_disco_info(); |
102 reply_query.node = node; | 102 reply_query.attr.node = node; |
103 local reply = st.reply(stanza):add_child(reply_query); | 103 local reply = st.reply(stanza):add_child(reply_query); |
104 origin.send(reply); | 104 origin.send(reply); |
105 return true; | 105 return true; |
106 end); | 106 end); |
107 module:hook("iq/host/http://jabber.org/protocol/disco#items:query", function(event) | 107 module:hook("iq/host/http://jabber.org/protocol/disco#items:query", function(event) |