Comparison

plugins/mod_component.lua @ 3615:c72d24c2d97b

mod_component: Return true from stanza handler to indicate that we actually did handle the stanza.
author Waqas Hussain <waqas20@gmail.com>
date Fri, 12 Nov 2010 22:39:37 +0500
parent 3604:3e89f0509967
child 3616:95ae7af2c82b
comparison
equal deleted inserted replaced
3614:8b436cc88c0e 3615:c72d24c2d97b
39 log("warn", "Stanza being handled by default component; bouncing error for: %s", stanza:top_tag()); 39 log("warn", "Stanza being handled by default component; bouncing error for: %s", stanza:top_tag());
40 if stanza.attr.type ~= "error" and stanza.attr.type ~= "result" then 40 if stanza.attr.type ~= "error" and stanza.attr.type ~= "result" then
41 event.origin.send(st.error_reply(stanza, "wait", "service-unavailable", "Component unavailable")); 41 event.origin.send(st.error_reply(stanza, "wait", "service-unavailable", "Component unavailable"));
42 end 42 end
43 end 43 end
44 return true;
44 end 45 end
45 46
46 module:hook("iq/bare", handle_stanza); 47 module:hook("iq/bare", handle_stanza);
47 module:hook("message/bare", handle_stanza); 48 module:hook("message/bare", handle_stanza);
48 module:hook("presence/bare", handle_stanza); 49 module:hook("presence/bare", handle_stanza);