Comparison

plugins/mod_component.lua @ 8888:cbcac5b9b7ce

Merge 0.10->trunk
author Kim Alvefur <zash@zash.se>
date Fri, 08 Jun 2018 16:15:32 +0200
parent 8518:0de0018bdf91
parent 8886:9aa35cb939ac
child 9562:acf74ad0b795
comparison
equal deleted inserted replaced
8885:d4f5d47f874d 8888:cbcac5b9b7ce
117 local query = stanza.tags[1]; 117 local query = stanza.tags[1];
118 local node = query.attr.node; 118 local node = query.attr.node;
119 if query.name == "query" and query.attr.xmlns == "http://jabber.org/protocol/disco#info" and (not node or node == "") then 119 if query.name == "query" and query.attr.xmlns == "http://jabber.org/protocol/disco#info" and (not node or node == "") then
120 local name = module:get_option_string("name"); 120 local name = module:get_option_string("name");
121 if name then 121 if name then
122 event.origin.send(st.reply(stanza):tag("query", { xmlns = "http://jabber.org/protocol/disco#info" }) 122 local reply = st.reply(stanza):tag("query", { xmlns = "http://jabber.org/protocol/disco#info" })
123 :tag("identity", { category = "component", type = "generic", name = module:get_option_string("name", "Prosody") })):up() 123 :tag("identity", { category = "component", type = "generic", name = module:get_option_string("name", "Prosody") }):up()
124 :tag("feature", { var = "http://jabber.org/protocol/disco#info" }):up() 124 :tag("feature", { var = "http://jabber.org/protocol/disco#info" }):up();
125 event.origin.send(reply);
125 return true; 126 return true;
126 end 127 end
127 end 128 end
128 end 129 end
129 module:log("warn", "Component not connected, bouncing error for: %s", stanza:top_tag()); 130 module:log("warn", "Component not connected, bouncing error for: %s", stanza:top_tag());