# HG changeset patch # User Seve Ferrer # Date 1608632840 -3600 # Node ID 33a41503b9e3560089c8c220340feb9cac4a222e # Parent a6c253bc63a5b243b02dc562842ffbeeef71f3a8 Improve UX by providing defaults users expect diff -r a6c253bc63a5 -r 33a41503b9e3 mod_muc_inject_mentions/README.markdown --- a/mod_muc_inject_mentions/README.markdown Tue Dec 22 11:18:46 2020 +0100 +++ b/mod_muc_inject_mentions/README.markdown Tue Dec 22 11:27:20 2020 +0100 @@ -49,7 +49,7 @@ -- muc_inject_mentions_disabled_rooms = {"room@conferences.server.com"} ``` -If none or both are found, all rooms in the muc component will have mentions enabled. +If none of these is set, all rooms in the muc component will have mentions enabled. By default, if a message contains at least one mention, diff -r a6c253bc63a5 -r 33a41503b9e3 mod_muc_inject_mentions/mod_muc_inject_mentions.lua --- a/mod_muc_inject_mentions/mod_muc_inject_mentions.lua Tue Dec 22 11:18:46 2020 +0100 +++ b/mod_muc_inject_mentions/mod_muc_inject_mentions.lua Tue Dec 22 11:27:20 2020 +0100 @@ -115,11 +115,9 @@ end local function is_room_eligible(jid) - if not enabled_rooms and not disabled_rooms then - return true; - end + if not enabled_rooms and not disabled_rooms then return true; end - if enabled_rooms and not disabled_rooms then + if enabled_rooms then for _, _jid in ipairs(enabled_rooms) do if _jid == jid then return true @@ -128,7 +126,7 @@ return false end - if disabled_rooms and not enabled_rooms then + if disabled_rooms then for _, _jid in ipairs(disabled_rooms) do if _jid == jid then return false @@ -136,8 +134,6 @@ end return true end - - return true end local function has_nick_prefix(body, first)