# HG changeset patch # User Kim Alvefur # Date 1601136850 -7200 # Node ID 33b6fbdcec88edb3bfa4029efc2a90a1fc6f66a4 # Parent 35d2260644d90ebeae1ac06fcbcedbec7acd7fc7 util.error: Default error originator to stanza sender The @by attribute is primarily useful for errors caused by intermediate entities. diff -r 35d2260644d9 -r 33b6fbdcec88 util/error.lua --- 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";