X-Git-Url: https://git.enpas.org/?a=blobdiff_plain;f=plugins%2Fmod_proxy65.lua;h=5b49073071736281f75752a4e54588a293229e08;hb=7d0d2419c6d4bb99a4bcf32f8aa866a4090a7397;hp=565cb38f54bebb66334b803356ef568fe3f1443a;hpb=4c8a018c89bf4b1f808e6511217c9574b6e056c0;p=prosody.git diff --git a/plugins/mod_proxy65.lua b/plugins/mod_proxy65.lua index 565cb38f..5b490730 100644 --- a/plugins/mod_proxy65.lua +++ b/plugins/mod_proxy65.lua @@ -117,6 +117,9 @@ function connlistener.ondisconnect(conn, err) end end +module:add_identity("proxy", "bytestreams", name); +module:add_feature("http://jabber.org/protocol/bytestreams"); + module:hook("iq-get/host/http://jabber.org/protocol/disco#info:query", function(event) local origin, stanza = event.origin, event.stanza; local reply = replies_cache.disco_info; @@ -192,15 +195,12 @@ module.unload = function() end local function set_activation(stanza) - local from, to, sid, reply = nil; - from = stanza.attr.from; - if stanza.tags[1] ~= nil and tostring(stanza.tags[1].name) == "query" then - if stanza.tags[1].attr ~= nil then - sid = stanza.tags[1].attr.sid; - end - if stanza.tags[1].tags[1] ~= nil and tostring(stanza.tags[1].tags[1].name) == "activate" then - to = stanza.tags[1].tags[1][1]; - end + local to, reply; + local from = stanza.attr.from; + local query = stanza.tags[1]; + local sid = query.attr.sid; + if query.tags[1] and query.tags[1].name == "activate" then + to = query.tags[1][1]; end if from ~= nil and to ~= nil and sid ~= nil then reply = st.iq({type="result", from=host, to=from});