adhoc.lib: Tweak to allow using util.error objects
authorKim Alvefur <zash@zash.se>
Sun, 31 Jan 2021 21:11:55 +0100
changeset 11355 6b541d3c4c1b
parent 11354 3287dbdde33e
child 11356 e10567199f02
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.
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