Diff

mod_muc_inject_mentions/mod_muc_inject_mentions.lua @ 4312:33a41503b9e3

Improve UX by providing defaults users expect
author Seve Ferrer <seve@delape.net>
date Tue, 22 Dec 2020 11:27:20 +0100
parent 4311:a6c253bc63a5
line wrap: on
line diff
--- 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)