# HG changeset patch # User Kim Alvefur # Date 1601250935 -7200 # Node ID 1ea3574b19c875f906ef2b2fc68a7d28e9f00e64 # Parent 03fdf41fd948e3d8c4c2777d6409e57f348325b6 util.error: Turns out wasn't alone, there's also diff -r 03fdf41fd948 -r 1ea3574b19c8 util/error.lua --- a/util/error.lua Sun Sep 27 00:17:48 2020 +0200 +++ b/util/error.lua Mon Sep 28 01:55:35 2020 +0200 @@ -98,12 +98,17 @@ 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);