aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKim Alvefur <zash@zash.se>2020-09-28 01:55:35 +0200
committerKim Alvefur <zash@zash.se>2020-09-28 01:55:35 +0200
commit04be6c2e839894756eaf4a3aa53a823508f14b12 (patch)
treeecfc9ab8723a86a82880b3c631f40e9155ff6419
parent60a6ee0d30769c9066fae19b7db7dbf92ea777b7 (diff)
downloadprosody-04be6c2e839894756eaf4a3aa53a823508f14b12.tar.gz
prosody-04be6c2e839894756eaf4a3aa53a823508f14b12.zip
util.error: Turns out <gone> wasn't alone, there's also <redirect>
-rw-r--r--util/error.lua9
1 files 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);