- local reply = st.reply(stanza);
- reply.attr.type = "error";
- if err == "conflict" then
- reply:tag("error", { code = "409", type = "cancel" })
- :tag("conflict", { xmlns = "urn:ietf:params:xml:ns:xmpp-stanzas" });
- elseif err == "constraint" then
- reply:tag("error", { code = "409", type = "cancel" })
- :tag("already-bound", { xmlns = "x-lxmppd:extensions:legacyauth" });
- elseif err == "auth" then
- reply:tag("error", { code = "401", type = "auth" })
- :tag("not-authorized", { xmlns = "urn:ietf:params:xml:ns:xmpp-stanzas" });
- end
- send(session, reply);
- return true;
+ session.send(st.error_reply(stanza, err_type, err, err_msg));
+ return true; -- FIXME need to unauthenticate here