Mercurial > prosody-modules
diff mod_http_muc_log/mod_http_muc_log.lua @ 3597:da7ec4ed6ddf
mod_http_muc_log: Hide join/part controls if they are not stored by mod_muc_mam
author | Kim Alvefur <zash@zash.se> |
---|---|
date | Thu, 16 May 2019 07:46:05 +0200 |
parents | 6e529f53b3c3 |
children | 8c0a6d4541d5 |
line wrap: on
line diff
--- a/mod_http_muc_log/mod_http_muc_log.lua Mon May 13 00:52:35 2019 +0200 +++ b/mod_http_muc_log/mod_http_muc_log.lua Thu May 16 07:46:05 2019 +0200 @@ -132,7 +132,12 @@ local lazy = module:get_option_boolean(module.name .. "_lazy_calendar", true); +local presence_logged = module:get_option_boolean("muc_log_presences", false); + local function hide_presence(request) + if not presence_logged then + return false; + end if request.url.query then local data = httplib.formdecode(request.url.query); if data then @@ -238,6 +243,7 @@ title = get_room(room):get_name(); jid = get_room(room).jid; hide_presence = hide_presence(request); + presence_available = presence_logged; years = years; links = { { href = "../", rel = "up", text = "Room list" }, @@ -358,6 +364,7 @@ title = ("%s - %s"):format(get_room(room):get_name(), date); jid = get_room(room).jid; hide_presence = hide_presence(request); + presence_available = presence_logged; lines = logs; links = { { href = "./", rel = "up", text = "Calendar" }, @@ -390,6 +397,7 @@ title = module:get_option_string("name", "Prosody Chatrooms"); jid = module.host; hide_presence = hide_presence(request); + presence_available = presence_logged; rooms = room_list; }); end