Software /
code /
prosody
Diff
plugins/muc/util.lib.lua @ 9599:5a2135964ed3 0.11
MUC: Announce affiliation changes for JIDs that are not in the room
author | Matthew Wild <mwild1@gmail.com> |
---|---|
date | Wed, 31 Oct 2018 13:13:05 +0000 |
parent | 6271:006b0e0f0de2 |
child | 9603:4897bd63f624 |
line wrap: on
line diff
--- a/plugins/muc/util.lib.lua Tue Oct 30 18:20:54 2018 +0100 +++ b/plugins/muc/util.lib.lua Wed Oct 31 13:13:05 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;