aboutsummaryrefslogtreecommitdiffstats
path: root/plugins/muc/util.lib.lua
diff options
context:
space:
mode:
authorMatthew Wild <mwild1@gmail.com>2018-10-31 13:17:02 +0000
committerMatthew Wild <mwild1@gmail.com>2018-10-31 13:17:02 +0000
commitd62045b02c9fc2e5cb2ee216690bc4fbb0e9cb45 (patch)
tree36c9480558963b704b270003ebc2f308daa2c0f0 /plugins/muc/util.lib.lua
parent8b6b43e64a5abb56445bc42dfb46e622d70a353a (diff)
parent54ecdb5cd0f5ed435de571a3795e2648c9145873 (diff)
downloadprosody-d62045b02c9fc2e5cb2ee216690bc4fbb0e9cb45.tar.gz
prosody-d62045b02c9fc2e5cb2ee216690bc4fbb0e9cb45.zip
Merge 0.11->trunk
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;