Mercurial > prosody-hg
diff plugins/muc/util.lib.lua @ 9600:ae0aca2c0ebb
Merge 0.11->trunk
| author | Matthew Wild <mwild1@gmail.com> |
|---|---|
| date | Wed, 31 Oct 2018 13:17:02 +0000 |
| parents | 5a2135964ed3 |
| children | 4897bd63f624 |
line wrap: on
line diff
--- a/plugins/muc/util.lib.lua Tue Oct 30 19:18:03 2018 +0100 +++ b/plugins/muc/util.lib.lua Wed Oct 31 13:17:02 2018 +0000 @@ -55,4 +55,13 @@ 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;
