plugins/mod_disco.lua
changeset 12019 b4db17aeff01
parent 11741 59cf555b4698
child 12020 b7e15abde27f
--- a/plugins/mod_disco.lua	Mon Dec 06 21:56:19 2021 +0100
+++ b/plugins/mod_disco.lua	Sat Jul 04 20:09:18 2020 +0200
@@ -8,6 +8,7 @@
 
 local get_children = require "core.hostmanager".get_children;
 local is_contact_subscribed = require "core.rostermanager".is_contact_subscribed;
+local um_is_admin = require "core.usermanager".is_admin;
 local jid_split = require "util.jid".split;
 local jid_bare = require "util.jid".bare;
 local st = require "util.stanza"
@@ -181,7 +182,11 @@
 		end
 		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();
+		if um_is_admin(stanza.attr.to or origin.full_jid, module.host) then
+			reply:tag('identity', {category='account', type='admin'}):up();
+		else
+			reply:tag('identity', {category='account', type='registered'}):up();
+		end
 		module:fire_event("account-disco-info", { origin = origin, reply = reply });
 		origin.send(reply);
 		return true;