# HG changeset patch # User Kim Alvefur # Date 1612123915 -3600 # Node ID 6b541d3c4c1b475acafbd482d8b0986d487347d5 # Parent 3287dbdde33e46a774a791261241ade1d805929e adhoc.lib: Tweak to allow using util.error objects Since util.stanza supports util.error objects via duck-typing and adhoc errors look enough like util.error objects, they should able to pass as such. This will allow converting adhoc commands to use util.error. diff -r 3287dbdde33e -r 6b541d3c4c1b plugins/adhoc/adhoc.lib.lua --- a/plugins/adhoc/adhoc.lib.lua Sun Jan 31 20:38:40 2021 +0100 +++ b/plugins/adhoc/adhoc.lib.lua Sun Jan 31 21:11:55 2021 +0100 @@ -51,7 +51,7 @@ cmdreply = command:cmdtag("canceled", sessionid); elseif data.status == "error" then states[sessionid] = nil; - local reply = st.error_reply(stanza, data.error.type, data.error.condition, data.error.message); + local reply = st.error_reply(stanza, data.error); origin.send(reply); return true; else