aboutsummaryrefslogtreecommitdiffstats
path: root/util
diff options
context:
space:
mode:
authorKim Alvefur <zash@zash.se>2020-09-26 18:07:33 +0200
committerKim Alvefur <zash@zash.se>2020-09-26 18:07:33 +0200
commit40800ea93bb1dca78c3548de58a09f424f5eef30 (patch)
tree6e7cf6570164fd9e7cd65403868c97911c932176 /util
parent10f82d332163c8a3572ee507e32611d56e930ca4 (diff)
downloadprosody-40800ea93bb1dca78c3548de58a09f424f5eef30.tar.gz
prosody-40800ea93bb1dca78c3548de58a09f424f5eef30.zip
util.stanza: Get 'by' from context instead
Zash> <error by=?> should go where? extra.by? context? source? Zash> In Prosody this would usually be module.host or a bare user/room JID MattJ> Zash: context MattJ> context.by, basically the opposite of context.actor
Diffstat (limited to 'util')
-rw-r--r--util/stanza.lua2
1 files changed, 1 insertions, 1 deletions
diff --git a/util/stanza.lua b/util/stanza.lua
index 2c936a40..3d0d5002 100644
--- a/util/stanza.lua
+++ b/util/stanza.lua
@@ -459,8 +459,8 @@ local function error_reply(orig, error_type, condition, error_message, error_by)
if type(error_type) == "table" then -- an util.error or similar object
if type(error_type.extra) == "table" then
extra = error_type.extra;
- if type(extra.by) == "string" then error_by = extra.by; end
end
+ if type(error_type.context) == "table" and type(error_type.context.by) == "string" then error_by = error_type.context.by; end
error_type, condition, error_message = error_type.type, error_type.condition, error_type.text;
end
if t.attr.from == error_by then