diff options
author | Kim Alvefur <zash@zash.se> | 2020-09-26 18:14:10 +0200 |
---|---|---|
committer | Kim Alvefur <zash@zash.se> | 2020-09-26 18:14:10 +0200 |
commit | 8f053aedc2be00ba51477dca694d0ff6eb928185 (patch) | |
tree | c5afaf0fea9183db0c74ad533040b4737c0220a5 /util | |
parent | aba41217c99b08a2c64b2177a33c03fa73d0f29e (diff) | |
download | prosody-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.lua | 3 |
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"; |