Comparison

plugins/mod_component.lua @ 10716:29575fe64860

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.
author Kim Alvefur <zash@zash.se>
date Sat, 11 Apr 2020 19:31:15 +0200
parent 10111:0f335815244f
child 11034:233196135048
comparison
equal deleted inserted replaced
10715:ad86b93093a3 10716:29575fe64860
130 end 130 end
131 end 131 end
132 end 132 end
133 module:log("warn", "Component not connected, bouncing error for: %s", stanza:top_tag()); 133 module:log("warn", "Component not connected, bouncing error for: %s", stanza:top_tag());
134 if stanza.attr.type ~= "error" and stanza.attr.type ~= "result" then 134 if stanza.attr.type ~= "error" and stanza.attr.type ~= "result" then
135 event.origin.send(st.error_reply(stanza, "wait", "service-unavailable", "Component unavailable")); 135 event.origin.send(st.error_reply(stanza, "wait", "service-unavailable", "Component unavailable", module.host));
136 end 136 end
137 end 137 end
138 return true; 138 return true;
139 end 139 end
140 140