mod_disco: Add an account/registered identity on subscribed accounts, fixes #826.
authorEmmanuel Gil Peyrot <linkmauve@linkmauve.fr>
Sat, 27 May 2017 15:53:30 +0100
changeset 8158 f0d847316723
parent 8155 8e26672df704
child 8159 745e0a783055
child 8163 5566f82ffea4
mod_disco: Add an account/registered identity on subscribed accounts, fixes #826.
plugins/mod_disco.lua
--- a/plugins/mod_disco.lua	Sat May 27 14:23:43 2017 +0100
+++ b/plugins/mod_disco.lua	Sat May 27 15:53:30 2017 +0100
@@ -138,6 +138,7 @@
 	if not stanza.attr.to or is_contact_subscribed(username, module.host, jid_bare(stanza.attr.from)) then
 		local reply = st.reply(stanza):tag('query', {xmlns='http://jabber.org/protocol/disco#info'});
 		if not reply.attr.from then reply.attr.from = origin.username.."@"..origin.host; end -- COMPAT To satisfy Psi when querying own account
+		reply:tag('identity', {category='account', type='registered'}):up();
 		module:fire_event("account-disco-info", { origin = origin, stanza = reply });
 		origin.send(reply);
 		return true;