mod_component: Return extended error condition when not connected
authorKim Alvefur <zash@zash.se>
Mon, 13 Apr 2020 02:49:19 +0200
changeset 11039 ba1143ddae9b
parent 11038 233196135048
child 11040 79e410cd7f6e
mod_component: Return extended error condition when not connected This might be something to write a XEP about.
plugins/mod_component.lua
--- a/plugins/mod_component.lua	Mon Apr 13 02:46:03 2020 +0200
+++ b/plugins/mod_component.lua	Mon Apr 13 02:49:19 2020 +0200
@@ -132,7 +132,8 @@
 			end
 			module:log("warn", "Component not connected, bouncing error for: %s", stanza:top_tag());
 			if stanza.attr.type ~= "error" and stanza.attr.type ~= "result" then
-				event.origin.send(st.error_reply(stanza, "wait", "remote-server-timeout", "Component unavailable", module.host));
+				event.origin.send(st.error_reply(stanza, "wait", "remote-server-timeout", "Component unavailable", module.host)
+					:tag("not-connected", { xmlns = "xmpp:prosody.im/protocol/component" }));
 			end
 		end
 		return true;