Mercurial > prosody-modules
changeset 6539:4d7e2d0db2ab
mod_muc_mav: include occupant-id in affiliation list
| author | Stephen Paul Weber <singpolyma@singpolyma.net> |
|---|---|
| date | Mon, 18 May 2026 10:23:12 -0500 |
| parents | de1f17ed4dac |
| children | 7cb25e7d945d |
| files | mod_muc_mav/mod_muc_mav.lua |
| diffstat | 1 files changed, 4 insertions(+), 1 deletions(-) [+] |
line wrap: on
line diff
--- a/mod_muc_mav/mod_muc_mav.lua Mon May 11 13:37:19 2026 +0100 +++ b/mod_muc_mav/mod_muc_mav.lua Mon May 18 10:23:12 2026 -0500 @@ -7,6 +7,7 @@ local xmlns_mav = "urn:xmpp:muc:affiliations:1"; local xmlns_muc = "http://jabber.org/protocol/muc"; local xmlns_muc_user = "http://jabber.org/protocol/muc#user"; +local xmlns_occupant_id = "urn:xmpp:occupant-id:0"; local mav_versions = {} @@ -15,8 +16,10 @@ local x = st.stanza("x", {xmlns = xmlns_muc_user;}); for jid, affiliation, affiliation_data in room:each_affiliation() do table.insert(jid_affiliations, jid.."\0"..affiliation); + local occupant_id = room:get_occupant_id_from_jid(jid); local nick = affiliation_data and affiliation_data.reserved_nickname; - x:tag("item", {affiliation = affiliation or "none"; jid = jid; nick = nick;}):up(); + x:tag("item", {affiliation = affiliation or "none"; jid = jid; nick = nick;}) + :tag("occupant-id", { xmlns = xmlns_occupant_id, id = occupant_id }):up():up(); end table.sort(jid_affiliations); local hash_input = table.concat(jid_affiliations, "\0");
