Software /
code /
prosody
Changeset
11090:33b6fbdcec88
util.error: Default error originator to stanza sender
The @by attribute is primarily useful for errors caused by intermediate
entities.
author | Kim Alvefur <zash@zash.se> |
---|---|
date | Sat, 26 Sep 2020 18:14:10 +0200 |
parents | 11089:35d2260644d9 |
children | 11091:4b4b5188492f |
files | util/error.lua |
diffstat | 1 files changed, 2 insertions(+), 1 deletions(-) [+] |
line wrap: on
line diff
--- a/util/error.lua Sat Sep 26 18:13:27 2020 +0200 +++ b/util/error.lua Sat Sep 26 18:14:10 2020 +0200 @@ -96,7 +96,8 @@ 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";