Comparison

plugins/mod_disco.lua @ 12016:b7e15abde27f

mod_disco: Advertise anonymous users Can these even be seen?
author Kim Alvefur <zash@zash.se>
date Sat, 04 Jul 2020 20:10:18 +0200
parent 12015:b4db17aeff01
child 12017:b3f040e57835
comparison
equal deleted inserted replaced
12015:b4db17aeff01 12016: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);