mod_component: Specify an error source for Component unavailable errors
authorKim Alvefur <zash@zash.se>
Sat, 11 Apr 2020 19:31:15 +0200
changeset 10720 29575fe64860
parent 10719 ad86b93093a3
child 10721 05e4645fc9b3
mod_component: Specify an error source for Component unavailable errors It is somewhat ambiguous where an error really comes from in the case of an external component. Setting by to the bare host at least distinguishes it from JIDs with a node- or resourcepart.
plugins/mod_component.lua
--- a/plugins/mod_component.lua	Sat Apr 11 17:59:39 2020 +0200
+++ b/plugins/mod_component.lua	Sat Apr 11 19:31:15 2020 +0200
@@ -132,7 +132,7 @@
 			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", "service-unavailable", "Component unavailable"));
+				event.origin.send(st.error_reply(stanza, "wait", "service-unavailable", "Component unavailable", module.host));
 			end
 		end
 		return true;