# HG changeset patch # User Kim Alvefur # Date 1557985565 -7200 # Node ID da7ec4ed6ddf6d3aa723f9d71f7a2a311291bb97 # Parent 6e529f53b3c3dde57eb85843fbdf7e8174bb6f65 mod_http_muc_log: Hide join/part controls if they are not stored by mod_muc_mam diff -r 6e529f53b3c3 -r da7ec4ed6ddf mod_http_muc_log/http_muc_log.html --- a/mod_http_muc_log/http_muc_log.html Mon May 13 00:52:35 2019 +0200 +++ b/mod_http_muc_log/http_muc_log.html Thu May 16 07:46:05 2019 +0200 @@ -72,7 +72,7 @@
-
+{presence_available&
    {lines# diff -r 6e529f53b3c3 -r da7ec4ed6ddf mod_http_muc_log/mod_http_muc_log.lua --- 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