aboutsummaryrefslogtreecommitdiffstats
path: root/util
diff options
context:
space:
mode:
authorKim Alvefur <zash@zash.se>2020-09-26 18:14:10 +0200
committerKim Alvefur <zash@zash.se>2020-09-26 18:14:10 +0200
commit8627f2e4d560a5fa4a2f9acf638f6535b9df8f26 (patch)
treec5afaf0fea9183db0c74ad533040b4737c0220a5 /util
parent0354452a9a537d141e61d09b553e1ceadf97cf42 (diff)
downloadprosody-8627f2e4d560a5fa4a2f9acf638f6535b9df8f26.tar.gz
prosody-8627f2e4d560a5fa4a2f9acf638f6535b9df8f26.zip
util.error: Default error originator to stanza sender
The @by attribute is primarily useful for errors caused by intermediate entities.
Diffstat (limited to 'util')
-rw-r--r--util/error.lua3
1 files changed, 2 insertions, 1 deletions
diff --git a/util/error.lua b/util/error.lua
index c2b7d149..0fe6cfa2 100644
--- a/util/error.lua
+++ b/util/error.lua
@@ -96,7 +96,8 @@ local function from_stanza(stanza, context)
local error_tag = stanza:get_child("error");
context = context or {};
context.stanza = stanza;
- context.by = error_tag.attr.by;
+ context.by = error_tag.attr.by or stanza.attr.from;
+
return setmetatable({
type = error_type or "cancel";
condition = condition or "undefined-condition";