aboutsummaryrefslogtreecommitdiffstats
path: root/plugins/mod_component.lua
diff options
context:
space:
mode:
authorMatthew Wild <mwild1@gmail.com>2012-07-31 23:07:02 +0100
committerMatthew Wild <mwild1@gmail.com>2012-07-31 23:07:02 +0100
commitd4d93a75bbf30b598c71f490f77262e9a4c79b2d (patch)
tree4301677c927a8fa3e7991312c13ee59ab0003a38 /plugins/mod_component.lua
parent4b640bb161bdcaf092c1445700b0a3b5a7c89b6f (diff)
parent2161f2e88c3b8b882fc30ec49609d4262d18e380 (diff)
downloadprosody-d4d93a75bbf30b598c71f490f77262e9a4c79b2d.tar.gz
prosody-d4d93a75bbf30b598c71f490f77262e9a4c79b2d.zip
Merge Waqas<>Zash
Diffstat (limited to 'plugins/mod_component.lua')
-rw-r--r--plugins/mod_component.lua12
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"));