From c19a8ef9ff319d31991e1dd8a23bdd9efb9389bb Mon Sep 17 00:00:00 2001 From: Matthew Wild Date: Wed, 31 Oct 2018 13:13:05 +0000 Subject: MUC: Announce affiliation changes for JIDs that are not in the room --- plugins/muc/util.lib.lua | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'plugins/muc/util.lib.lua') 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; -- cgit v1.2.3