From d9e80064b5e57d3055a4d0e93f732e14c4c11a11 Mon Sep 17 00:00:00 2001 From: Kim Alvefur Date: Sat, 26 Sep 2020 17:18:17 +0200 Subject: util.stanza: Reorder code to prepare for extracting 'by' from util.error --- util/stanza.lua | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'util/stanza.lua') 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 -- cgit v1.2.3