comparison plugins/muc/hats.lib.lua @ 14094:9bcd58e8e9f9 13.0

MUC: Advertise hats feature on room JID (thanks Daniel)
author Matthew Wild <mwild1@gmail.com>
date Thu, 26 Feb 2026 15:09:16 +0000
parents 18bc411d61fe
children
comparison
equal deleted inserted replaced
14090:2aeb5dcb36bf 14094:9bcd58e8e9f9
7 local xmlns_hats = "urn:xmpp:hats:0"; 7 local xmlns_hats = "urn:xmpp:hats:0";
8 8
9 -- Strip any hats claimed by the client (to prevent spoofing) 9 -- Strip any hats claimed by the client (to prevent spoofing)
10 muc_util.add_filtered_namespace(xmlns_hats); 10 muc_util.add_filtered_namespace(xmlns_hats);
11 11
12 module:hook("muc-disco#info", function(event)
13 event.reply:tag("feature", { var = xmlns_hats }):up();
14 end);
12 15
13 module:hook("muc-build-occupant-presence", function (event) 16 module:hook("muc-build-occupant-presence", function (event)
14 local bare_jid = event.occupant and event.occupant.bare_jid or event.bare_jid; 17 local bare_jid = event.occupant and event.occupant.bare_jid or event.bare_jid;
15 local aff_data = event.room:get_affiliation_data(bare_jid); 18 local aff_data = event.room:get_affiliation_data(bare_jid);
16 local hats = aff_data and aff_data.hats; 19 local hats = aff_data and aff_data.hats;