# HG changeset patch # User Kim Alvefur # Date 1527527209 -7200 # Node ID f69a2e97d91273d1bbc06148eb9ae01c5f1f1d0e # Parent 6fce9a935b389460cd9dfd5e9ab5b07921f9ebaa mod_http_muc_log: Improve readability of policy function diff -r 6fce9a935b38 -r f69a2e97d912 mod_http_muc_log/mod_http_muc_log.lua --- a/mod_http_muc_log/mod_http_muc_log.lua Mon May 28 18:53:43 2018 +0200 +++ b/mod_http_muc_log/mod_http_muc_log.lua Mon May 28 19:06:49 2018 +0200 @@ -52,9 +52,19 @@ if type(room) == "string" then room = get_room(room); end - return (room - and not (room.get_hidden or room.is_hidden)(room) - and not (room.get_members_only or room.is_members_only)(room)) + if not room then + return nil; + end + + if (room.get_hidden or room.is_hidden)(room) then + return nil; + end + + if (room.get_members_only or room.is_members_only)(room) then + return false; + end + + return true; end local function sort_Y(a,b) return a.year > b.year end