Software /
code /
prosody-modules
Comparison
mod_http_muc_log/mod_http_muc_log.lua @ 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 |
parent | 2846:7eb23a4e7fde |
child | 3058:4d46658b6998 |
comparison
equal
deleted
inserted
replaced
3056:6fce9a935b38 | 3057:f69a2e97d912 |
---|---|
50 | 50 |
51 local function public_room(room) -- : boolean | 51 local function public_room(room) -- : boolean |
52 if type(room) == "string" then | 52 if type(room) == "string" then |
53 room = get_room(room); | 53 room = get_room(room); |
54 end | 54 end |
55 return (room | 55 if not room then |
56 and not (room.get_hidden or room.is_hidden)(room) | 56 return nil; |
57 and not (room.get_members_only or room.is_members_only)(room)) | 57 end |
58 | |
59 if (room.get_hidden or room.is_hidden)(room) then | |
60 return nil; | |
61 end | |
62 | |
63 if (room.get_members_only or room.is_members_only)(room) then | |
64 return false; | |
65 end | |
66 | |
67 return true; | |
58 end | 68 end |
59 | 69 |
60 local function sort_Y(a,b) return a.year > b.year end | 70 local function sort_Y(a,b) return a.year > b.year end |
61 local function sort_m(a,b) return a.n > b.n end | 71 local function sort_m(a,b) return a.n > b.n end |
62 | 72 |