aboutsummaryrefslogtreecommitdiffstats
path: root/plugins/mod_disco.lua
diff options
context:
space:
mode:
Diffstat (limited to 'plugins/mod_disco.lua')
-rw-r--r--plugins/mod_disco.lua10
1 files changed, 10 insertions, 0 deletions
diff --git a/plugins/mod_disco.lua b/plugins/mod_disco.lua
index a5479f4c..12e4357b 100644
--- a/plugins/mod_disco.lua
+++ b/plugins/mod_disco.lua
@@ -71,6 +71,7 @@ local function build_server_disco_info()
ver = _cached_server_caps_hash;
});
end
+
local function clear_disco_cache()
_cached_server_disco_info, _cached_server_caps_feature, _cached_server_caps_hash = nil, nil, nil;
end
@@ -116,6 +117,7 @@ module:hook("iq-get/host/http://jabber.org/protocol/disco#info:query", function(
origin.send(reply);
return true;
end);
+
module:hook("iq-get/host/http://jabber.org/protocol/disco#items:query", function(event)
local origin, stanza = event.origin, event.stanza;
local node = stanza.tags[1].attr.node;
@@ -151,6 +153,12 @@ module:hook("stream-features", function (event)
end
end);
+module:hook("s2s-stream-features", function (event)
+ if event.origin.type == "s2sin" then
+ event.features:add_child(get_server_caps_feature());
+ end
+end);
+
-- Handle disco requests to user accounts
if module:get_host_type() ~= "local" then return end -- skip for components
module:hook("iq-get/bare/http://jabber.org/protocol/disco#info:query", function(event)
@@ -179,6 +187,7 @@ module:hook("iq-get/bare/http://jabber.org/protocol/disco#info:query", function(
return true;
end
end);
+
module:hook("iq-get/bare/http://jabber.org/protocol/disco#items:query", function(event)
local origin, stanza = event.origin, event.stanza;
local node = stanza.tags[1].attr.node;
@@ -204,3 +213,4 @@ module:hook("iq-get/bare/http://jabber.org/protocol/disco#items:query", function
return true;
end
end);
+