From 04be6c2e839894756eaf4a3aa53a823508f14b12 Mon Sep 17 00:00:00 2001 From: Kim Alvefur Date: Mon, 28 Sep 2020 01:55:35 +0200 Subject: util.error: Turns out wasn't alone, there's also --- util/error.lua | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/util/error.lua b/util/error.lua index fd6deb80..44eb59a2 100644 --- a/util/error.lua +++ b/util/error.lua @@ -98,12 +98,17 @@ local function from_stanza(stanza, context, source) context.stanza = stanza; context.by = error_tag.attr.by or stanza.attr.from; + local uri; + if condition == "gone" or condition == "redirect" then + uri = error_tag:get_child_text(condition, "urn:ietf:params:xml:ns:xmpp-stanzas"); + end + return new({ type = error_type or "cancel"; condition = condition or "undefined-condition"; text = text; - extra = (extra_tag or condition == "gone") and { - uri = error_tag:get_child_text("gone", "urn:ietf:params:xml:ns:xmpp-stanzas"); + extra = (extra_tag or uri) and { + uri = uri; tag = extra_tag; } or nil; }, context, nil, source); -- cgit v1.2.3