comparison mod_rest/mod_rest.lua @ 3824:a0b8ec44a36b

mod_rest: Stanzas of type error don't need a reply
author Kim Alvefur <zash@zash.se>
date Thu, 02 Jan 2020 09:57:49 +0100
parents 11272a3233ce
children 802087d3155a
comparison
equal deleted inserted replaced
3823:31b1797a78e1 3824:a0b8ec44a36b
179 179
180 local function handle_stanza(event) 180 local function handle_stanza(event)
181 local stanza, origin = event.stanza, event.origin; 181 local stanza, origin = event.stanza, event.origin;
182 local reply_needed = stanza.name == "iq"; 182 local reply_needed = stanza.name == "iq";
183 local receipt; 183 local receipt;
184
185 if stanza.attr.type == "error" then
186 reply_needed = false;
187 end
184 188
185 if stanza.name == "message" and stanza.attr.id and stanza:get_child("urn:xmpp:receipts", "request") then 189 if stanza.name == "message" and stanza.attr.id and stanza:get_child("urn:xmpp:receipts", "request") then
186 reply_needed = true; 190 reply_needed = true;
187 receipt = st.stanza("received", { xmlns = "urn:xmpp:receipts", id = stanza.id }); 191 receipt = st.stanza("received", { xmlns = "urn:xmpp:receipts", id = stanza.id });
188 end 192 end