aboutsummaryrefslogtreecommitdiffstats
path: root/util/stanza.lua
diff options
context:
space:
mode:
Diffstat (limited to 'util/stanza.lua')
-rw-r--r--util/stanza.lua3
1 files changed, 3 insertions, 0 deletions
diff --git a/util/stanza.lua b/util/stanza.lua
index 8e46f90f..f5cd5668 100644
--- a/util/stanza.lua
+++ b/util/stanza.lua
@@ -458,6 +458,9 @@ local function error_reply(orig, error_type, condition, error_message, error_by)
if t.attr.from == error_by then
error_by = nil;
end
+ if type(error_type) == "table" then -- an util.error or similar object
+ error_type, condition, error_message = error_type.type, error_type.condition, error_type.text;
+ end
t:tag("error", {type = error_type, by = error_by}) --COMPAT: Some day xmlns:stanzas goes here
:tag(condition, xmpp_stanzas_attr):up();
if error_message then t:text_tag("text", error_message, xmpp_stanzas_attr); end