diff options
author | Matthew Wild <mwild1@gmail.com> | 2012-07-31 23:07:02 +0100 |
---|---|---|
committer | Matthew Wild <mwild1@gmail.com> | 2012-07-31 23:07:02 +0100 |
commit | db304d412cbb2c4529bc3bf911dcee0747ea9084 (patch) | |
tree | 4301677c927a8fa3e7991312c13ee59ab0003a38 /plugins/mod_component.lua | |
parent | 56c30635ccf2c210fbb37e83e28f7d956dc6c74f (diff) | |
parent | 5e947f4b086e5818b0aac35fe2bbd2079fbf4077 (diff) | |
download | prosody-db304d412cbb2c4529bc3bf911dcee0747ea9084.tar.gz prosody-db304d412cbb2c4529bc3bf911dcee0747ea9084.zip |
Merge Waqas<>Zash
Diffstat (limited to 'plugins/mod_component.lua')
-rw-r--r-- | plugins/mod_component.lua | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/plugins/mod_component.lua b/plugins/mod_component.lua index 751de59b..cff54f61 100644 --- a/plugins/mod_component.lua +++ b/plugins/mod_component.lua @@ -93,6 +93,18 @@ function module.add_host(module) stanza.attr.xmlns = nil; send(stanza); else + if stanza.name == "iq" and stanza.attr.type == "get" and stanza.attr.to == module.host then + local query = stanza.tags[1]; + local node = query.attr.node; + if query.name == "query" and query.attr.xmlns == "http://jabber.org/protocol/disco#info" and (not node or node == "") then + local name = module:get_option_string("name"); + if name then + event.origin.send(st.reply(stanza):tag("query", { xmlns = "http://jabber.org/protocol/disco#info" }) + :tag("identity", { category = "component", type = "generic", name = module:get_option_string("name", "Prosody") })) + return true; + end + end + 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")); |