aboutsummaryrefslogtreecommitdiffstats
path: root/plugins/muc/muc.lib.lua
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
commit2029dbf49613757e2621270a6e0c520d52689311 (patch)
treec2f8a63dfbc790f6522db8cae081107aae358a15 /plugins/muc/muc.lib.lua
parent58d6d5c41d3a685f0d2bb7e3d691c4891deeb5db (diff)
downloadprosody-2029dbf49613757e2621270a6e0c520d52689311.tar.gz
prosody-2029dbf49613757e2621270a6e0c520d52689311.zip
MUC: Add function to retrieve affiliation data for a given JID
Diffstat (limited to 'plugins/muc/muc.lib.lua')
-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;