changeset 3057:f69a2e97d912

mod_http_muc_log: Improve readability of policy function
author Kim Alvefur <zash@zash.se>
date Mon, 28 May 2018 19:06:49 +0200 (2018-05-28)
parents 6fce9a935b38
children 4d46658b6998
files mod_http_muc_log/mod_http_muc_log.lua
diffstat 1 files changed, 13 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- 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