Comparison

plugins/mod_disco.lua @ 8834:b0093d3b2d04

mod_disco: Skip code specific to disco on user accounts (avoids invoking usermanager, fixes #1150)
author Kim Alvefur <zash@zash.se>
date Mon, 28 May 2018 21:30:32 +0200
parent 8188:8c524b7c9017
child 9223:80dbb60d81e4
comparison
equal deleted inserted replaced
8827:1a29b56a2d63 8834:b0093d3b2d04
152 event.features:add_child(get_server_caps_feature()); 152 event.features:add_child(get_server_caps_feature());
153 end 153 end
154 end); 154 end);
155 155
156 -- Handle disco requests to user accounts 156 -- Handle disco requests to user accounts
157 if module:get_host_type() ~= "local" then return end -- skip for components
157 module:hook("iq/bare/http://jabber.org/protocol/disco#info:query", function(event) 158 module:hook("iq/bare/http://jabber.org/protocol/disco#info:query", function(event)
158 local origin, stanza = event.origin, event.stanza; 159 local origin, stanza = event.origin, event.stanza;
159 if stanza.attr.type ~= "get" then return; end 160 if stanza.attr.type ~= "get" then return; end
160 local node = stanza.tags[1].attr.node; 161 local node = stanza.tags[1].attr.node;
161 local username = jid_split(stanza.attr.to) or origin.username; 162 local username = jid_split(stanza.attr.to) or origin.username;