aboutsummaryrefslogtreecommitdiffstats
path: root/util/stanza.lua
diff options
context:
space:
mode:
authorKim Alvefur <zash@zash.se>2020-09-26 18:09:10 +0200
committerKim Alvefur <zash@zash.se>2020-09-26 18:09:10 +0200
commit1c53f533b09008be2ed26e3ffccc31c2609cc566 (patch)
treedee52ffe239a67fec2c369374320904f2cbfbf1f /util/stanza.lua
parent8c0efc9e55d0980e2ce5872da325724aeaec5dba (diff)
downloadprosody-1c53f533b09008be2ed26e3ffccc31c2609cc566.tar.gz
prosody-1c53f533b09008be2ed26e3ffccc31c2609cc566.zip
util.stanza: Support Application-Specific Conditions in util.error
Diffstat (limited to 'util/stanza.lua')
-rw-r--r--util/stanza.lua5
1 files changed, 5 insertions, 0 deletions
diff --git a/util/stanza.lua b/util/stanza.lua
index 3d0d5002..9bcf3747 100644
--- a/util/stanza.lua
+++ b/util/stanza.lua
@@ -473,6 +473,11 @@ local function error_reply(orig, error_type, condition, error_message, error_by)
end
t:up();
if error_message then t:text_tag("text", error_message, xmpp_stanzas_attr); end
+ if extra and is_stanza(extra.tag) then
+ t:add_child(extra.tag);
+ elseif extra and extra.namespace and extra.condition then
+ t:tag(extra.condition, { xmlns = extra.namespace }):up();
+ end
return t; -- stanza ready for adding app-specific errors
end