From a51d5912465d8129ab062572d1f2e2bdddf967e6 Mon Sep 17 00:00:00 2001 From: Kim Alvefur Date: Sat, 26 Sep 2020 18:15:49 +0200 Subject: util.error: Collect Application-Specific Conditions from stanza errors --- util/error.lua | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'util') diff --git a/util/error.lua b/util/error.lua index c0b87d86..92567248 100644 --- a/util/error.lua +++ b/util/error.lua @@ -92,7 +92,7 @@ local function coerce(ok, err, ...) end local function from_stanza(stanza, context) - local error_type, condition, text = stanza:get_error(); + local error_type, condition, text, extra_tag = stanza:get_error(); local error_tag = stanza:get_child("error"); context = context or {}; context.stanza = stanza; @@ -102,8 +102,9 @@ local function from_stanza(stanza, context) type = error_type or "cancel"; condition = condition or "undefined-condition"; text = text; - extra = condition == "gone" and { + extra = (extra_tag or condition == "gone") and { uri = error_tag:get_child_text("gone", "urn:ietf:params:xml:ns:xmpp-stanzas"); + tag = extra_tag; } or nil; context = context; -- cgit v1.2.3