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 | d9e80064b5e57d3055a4d0e93f732e14c4c11a11 (patch) | |
tree | cee8ae651526955113149f4e66a927d92e09a8d2 /util | |
parent | ed5841e42b9c6b2ae31ba5f9a5767e67e2fb71d4 (diff) | |
download | prosody-d9e80064b5e57d3055a4d0e93f732e14c4c11a11.tar.gz prosody-d9e80064b5e57d3055a4d0e93f732e14c4c11a11.zip |
util.stanza: Reorder code to prepare for extracting 'by' from util.error
Diffstat (limited to 'util')
-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 |