plugins/mod_disco.lua
changeset 8158 f0d847316723
parent 8005 57060d0cee4b
child 8159 745e0a783055
equal deleted inserted replaced
8155:8e26672df704 8158:f0d847316723
   136 	if node and node ~= "" then return; end -- TODO fire event?
   136 	if node and node ~= "" then return; end -- TODO fire event?
   137 	local username = jid_split(stanza.attr.to) or origin.username;
   137 	local username = jid_split(stanza.attr.to) or origin.username;
   138 	if not stanza.attr.to or is_contact_subscribed(username, module.host, jid_bare(stanza.attr.from)) then
   138 	if not stanza.attr.to or is_contact_subscribed(username, module.host, jid_bare(stanza.attr.from)) then
   139 		local reply = st.reply(stanza):tag('query', {xmlns='http://jabber.org/protocol/disco#info'});
   139 		local reply = st.reply(stanza):tag('query', {xmlns='http://jabber.org/protocol/disco#info'});
   140 		if not reply.attr.from then reply.attr.from = origin.username.."@"..origin.host; end -- COMPAT To satisfy Psi when querying own account
   140 		if not reply.attr.from then reply.attr.from = origin.username.."@"..origin.host; end -- COMPAT To satisfy Psi when querying own account
       
   141 		reply:tag('identity', {category='account', type='registered'}):up();
   141 		module:fire_event("account-disco-info", { origin = origin, stanza = reply });
   142 		module:fire_event("account-disco-info", { origin = origin, stanza = reply });
   142 		origin.send(reply);
   143 		origin.send(reply);
   143 		return true;
   144 		return true;
   144 	end
   145 	end
   145 end);
   146 end);