Comparison

plugins/mod_component.lua @ 4323:53f3c3001499

mod_component: Clearer log message when bouncing a stanza from a component that is not connected (thanks MK)
author Matthew Wild <mwild1@gmail.com>
date Sat, 18 Jun 2011 14:04:56 +0100
parent 4301:1484ac561b28
child 4464:b0574fc78a0a
comparison
equal deleted inserted replaced
4322:aff627b1ce95 4323:53f3c3001499
33 local stanza = event.stanza; 33 local stanza = event.stanza;
34 if send then 34 if send then
35 stanza.attr.xmlns = nil; 35 stanza.attr.xmlns = nil;
36 send(stanza); 36 send(stanza);
37 else 37 else
38 log("warn", "Stanza being handled by default component; bouncing error for: %s", stanza:top_tag()); 38 log("warn", "Component not connected, bouncing error for: %s", stanza:top_tag());
39 if stanza.attr.type ~= "error" and stanza.attr.type ~= "result" then 39 if stanza.attr.type ~= "error" and stanza.attr.type ~= "result" then
40 event.origin.send(st.error_reply(stanza, "wait", "service-unavailable", "Component unavailable")); 40 event.origin.send(st.error_reply(stanza, "wait", "service-unavailable", "Component unavailable"));
41 end 41 end
42 end 42 end
43 return true; 43 return true;