diff options
author | Kim Alvefur <zash@zash.se> | 2020-09-26 17:18:17 +0200 |
---|---|---|
committer | Kim Alvefur <zash@zash.se> | 2020-09-26 17:18:17 +0200 |
commit | 05a3d574dce37d28621bfd35703b2a2283cfd1bd (patch) | |
tree | cee8ae651526955113149f4e66a927d92e09a8d2 /util/stanza.lua | |
parent | cfb933ba988b70d98c8694be2beb7c346e93f947 (diff) | |
download | prosody-05a3d574dce37d28621bfd35703b2a2283cfd1bd.tar.gz prosody-05a3d574dce37d28621bfd35703b2a2283cfd1bd.zip |
util.stanza: Reorder code to prepare for extracting 'by' from util.error
Diffstat (limited to 'util/stanza.lua')
-rw-r--r-- | util/stanza.lua | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/util/stanza.lua b/util/stanza.lua index a8a417ab..7d45d444 100644 --- a/util/stanza.lua +++ b/util/stanza.lua @@ -455,12 +455,12 @@ local function error_reply(orig, error_type, condition, error_message, error_by) end local t = reply(orig); t.attr.type = "error"; - 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 + if t.attr.from == error_by then + error_by = nil; + 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 |