Comparison

core/stanza_router.lua @ 6558:461217c45a18

stanza_router: Fix routing of 'error' IQs with multiple childs (thanks Pawel)
author Kim Alvefur <zash@zash.se>
date Tue, 06 Jan 2015 17:39:47 +0100
parent 6401:e3de64f7c44d
child 6559:0ef7ca5276a1
comparison
equal deleted inserted replaced
6523:63d3126b75f1 6558:461217c45a18
61 if st_type == "error" and #stanza.tags == 0 then 61 if st_type == "error" and #stanza.tags == 0 then
62 return handle_unhandled_stanza(origin.host, origin, stanza); 62 return handle_unhandled_stanza(origin.host, origin, stanza);
63 end 63 end
64 if name == "iq" then 64 if name == "iq" then
65 if not stanza.attr.id then stanza.attr.id = ""; end -- COMPAT Jabiru doesn't send the id attribute on roster requests 65 if not stanza.attr.id then stanza.attr.id = ""; end -- COMPAT Jabiru doesn't send the id attribute on roster requests
66 if not iq_types[st_type] or (st_type ~= "result" and #stanza.tags ~= 1) then 66 if not iq_types[st_type] or ((st_type == "set" or st_type == "get") and (#stanza.tags ~= 1)) then
67 origin.send(st.error_reply(stanza, "modify", "bad-request", "Invalid IQ type or incorrect number of children")); 67 origin.send(st.error_reply(stanza, "modify", "bad-request", "Invalid IQ type or incorrect number of children"));
68 return; 68 return;
69 end 69 end
70 end 70 end
71 71