view mod_http_muc_log/README.markdown @ 4738:5aee8d86629a

mod_bookmarks2: Fix handling of nick and password elements This form of child retrieval fails when the stanza elements internally don't have an 'xmlns' attribute, which can happen sometimes for some reason, including when they have been constructed via the stanza builder API. When that is the case then the explicit namespace arguemnt does not match the nil value of the internal attribute. Calling `:get_child()` without the namespace argument does the right thing here, with both nil and the parent namespace as valid values for the internal attribute.
author Kim Alvefur <zash@zash.se>
date Wed, 03 Nov 2021 21:11:55 +0100
parents 823370bc2e4c
children 8c7b7db69f5b
line wrap: on
line source

---
labels:
- 'Stage-Beta'
summary: Provides a web interface to stored chatroom logs
rockspec:
  build:
    copy_directories:
      - res
...

Introduction
============

This module provides a built-in web interface to view chatroom logs
stored by [mod\_mam\_muc].

Installation
============

Same as any other module, be sure to include the HTML template
`http_muc_log.html` alongside `mod_http_muc_log.lua`.

Configuration
=============

For example:

``` lua
Component "conference.example.com" "muc"
modules_enabled = {
    "mam_muc";
    "http_muc_log";
}
storage = {
    muc_log = "sql"; -- for example
}
```

The web interface would then be reachable at the address:

    http://conference.example.com:5280/muc_log/

See [the page about Prosodys HTTP server][doc:http] for info about the
address.

## Styling

The default HTML template lives in `http_muc_log.html` in the same
directory as the module, but can be changed by setting
`http_muc_log_template` to point to a different file. The same template,
with different input is used for every view.

The module uses [util.interpolation][doc:developers:util:interpolation]
for rendering templates, with the pattern `"%b{}"` and HTML / XML
escaping enabled.

## Default view

To link to the latest day instead of calendar from the room listing
page:

```lua
http_muc_log_default_view = "latest"
```

## Inline images

Inline images can optionally be shown. This is disabled by default for
privacy reasons.

``` {.lua}
http_muc_log_show_images = true
```

## Calendar optimization

The calendar view relies on an optional part of the Prosody archive
storage API that provides a list of every valid date. If this is
unavailable then the module queries for the first and the last messages
and assumes that every date between those is valid. This may lead to
many empty pages in case the logs are sparse.

This optimization can be turned off, to get a more accurate calendar
view, but it will likely be very slow.

``` {.lua}
http_muc_log_lazy_calendar = false
```

## Pinned chatrooms

The room list page is normally sorted by address, rooms having a
description before those that don't. To override this, or pin certain
rooms to the top:

``` lua
http_muc_log_list_order = {
    "general@channels.example.com",
    "support@channels.example.com",
}
```

Compatibility
=============

Requires Prosody 0.10 or above and a storage backend with support for
stanza archives. See [mod\_storage\_muc\_log] for using legacy data from
[mod\_muc\_log].