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
commit8f053aedc2be00ba51477dca694d0ff6eb928185 (patch)
treec5afaf0fea9183db0c74ad533040b4737c0220a5 /util
parentaba41217c99b08a2c64b2177a33c03fa73d0f29e (diff)
downloadprosody-8f053aedc2be00ba51477dca694d0ff6eb928185.tar.gz
prosody-8f053aedc2be00ba51477dca694d0ff6eb928185.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";