plugins/mod_disco.lua
changeset 12020 b7e15abde27f
parent 12019 b4db17aeff01
child 12021 b3f040e57835
equal deleted inserted replaced
12019:b4db17aeff01 12020:b7e15abde27f
   182 		end
   182 		end
   183 		local reply = st.reply(stanza):tag('query', {xmlns='http://jabber.org/protocol/disco#info'});
   183 		local reply = st.reply(stanza):tag('query', {xmlns='http://jabber.org/protocol/disco#info'});
   184 		if not reply.attr.from then reply.attr.from = origin.username.."@"..origin.host; end -- COMPAT To satisfy Psi when querying own account
   184 		if not reply.attr.from then reply.attr.from = origin.username.."@"..origin.host; end -- COMPAT To satisfy Psi when querying own account
   185 		if um_is_admin(stanza.attr.to or origin.full_jid, module.host) then
   185 		if um_is_admin(stanza.attr.to or origin.full_jid, module.host) then
   186 			reply:tag('identity', {category='account', type='admin'}):up();
   186 			reply:tag('identity', {category='account', type='admin'}):up();
       
   187 		elseif prosody.hosts[module.host].users.name == "anonymous" then
       
   188 			reply:tag('identity', {category='account', type='anonymous'}):up();
   187 		else
   189 		else
   188 			reply:tag('identity', {category='account', type='registered'}):up();
   190 			reply:tag('identity', {category='account', type='registered'}):up();
   189 		end
   191 		end
   190 		module:fire_event("account-disco-info", { origin = origin, reply = reply });
   192 		module:fire_event("account-disco-info", { origin = origin, reply = reply });
   191 		origin.send(reply);
   193 		origin.send(reply);