# HG changeset patch # User Matthew Wild # Date 1540135090 -3600 # Node ID 9bb33edd725513150f6a55629146e1664e4ca241 # Parent f2d70dc13700474dff2f2aca7617ba6602429fe3 MUC: Add function to retrieve affiliation data for a given JID diff -r f2d70dc13700 -r 9bb33edd7255 plugins/muc/muc.lib.lua --- a/plugins/muc/muc.lib.lua Sun Oct 21 16:17:55 2018 +0100 +++ b/plugins/muc/muc.lib.lua Sun Oct 21 16:18:10 2018 +0100 @@ -1346,6 +1346,15 @@ return true; end +function room_mt:get_affiliation_data(jid, key) + local data = self._affiliation_data[jid]; + if not data then return nil; end + if key then + return data[key]; + end + return data; +end + function room_mt:get_role(nick) local occupant = self:get_occupant_by_nick(nick); return occupant and occupant.role or nil;