aboutsummaryrefslogtreecommitdiffstats
path: root/plugins/muc/util.lib.lua
diff options
context:
space:
mode:
authorMatthew Wild <mwild1@gmail.com>2018-10-31 13:13:05 +0000
committerMatthew Wild <mwild1@gmail.com>2018-10-31 13:13:05 +0000
commit9a69512d819d05bd96987ac95b5f88517d3f6e7d (patch)
tree2b3c09fcbc5550d9a250ad9dfdd9a37661b6570c /plugins/muc/util.lib.lua
parent299aa07cb82da8d5185ff2ccbf10143e24b7e93c (diff)
downloadprosody-9a69512d819d05bd96987ac95b5f88517d3f6e7d.tar.gz
prosody-9a69512d819d05bd96987ac95b5f88517d3f6e7d.zip
MUC: Announce affiliation changes for JIDs that are not in the room
Diffstat (limited to 'plugins/muc/util.lib.lua')
-rw-r--r--plugins/muc/util.lib.lua9
1 files changed, 9 insertions, 0 deletions
diff --git a/plugins/muc/util.lib.lua b/plugins/muc/util.lib.lua
index 16deb543..d03b4d6b 100644
--- a/plugins/muc/util.lib.lua
+++ b/plugins/muc/util.lib.lua
@@ -55,4 +55,13 @@ function _M.filter_muc_x(stanza)
return stanza:maptags(muc_x_filter);
end
+function _M.only_with_min_role(role)
+ local min_role_value = _M.valid_roles[role];
+ return function (nick, occupant)
+ if _M.valid_roles[occupant.role or "none"] >= min_role_value then
+ return true;
+ end
+ end;
+end
+
return _M;