aboutsummaryrefslogtreecommitdiffstats
path: root/plugins/muc
diff options
context:
space:
mode:
authorMatthew Wild <mwild1@gmail.com>2018-10-21 16:18:10 +0100
committerMatthew Wild <mwild1@gmail.com>2018-10-21 16:18:10 +0100
commit75d54b80ed9b0af7ef743967d0e40bd3c97b1cf8 (patch)
treec2f8a63dfbc790f6522db8cae081107aae358a15 /plugins/muc
parent359dfd9316dfeedfce0ebc761b8f1b283e1e1dcd (diff)
downloadprosody-75d54b80ed9b0af7ef743967d0e40bd3c97b1cf8.tar.gz
prosody-75d54b80ed9b0af7ef743967d0e40bd3c97b1cf8.zip
MUC: Add function to retrieve affiliation data for a given JID
Diffstat (limited to 'plugins/muc')
-rw-r--r--plugins/muc/muc.lib.lua9
1 files changed, 9 insertions, 0 deletions
diff --git a/plugins/muc/muc.lib.lua b/plugins/muc/muc.lib.lua
index 4e1d32f2..c6ebed8f 100644
--- a/plugins/muc/muc.lib.lua
+++ b/plugins/muc/muc.lib.lua
@@ -1346,6 +1346,15 @@ function room_mt:set_affiliation(actor, jid, affiliation, reason, data)
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;