view mod_muc_markers/README.markdown @ 4326:f6fdefc5c6ac

mod_roster_command: Fix subscription when the "user JID" is a bare domain. Do not attempt to update the roster when the user is bare domain (e.g. a component), since they don't have rosters and the attempt results in an error: $ prosodyctl mod_roster_command subscribe proxy.example.com contact@example.com xxxxxxxxxxFailed to execute command: Error: /usr/lib/prosody/core/rostermanager.lua:104: attempt to concatenate local 'username' (a nil value) stack traceback: /usr/lib/prosody/core/rostermanager.lua:104: in function 'load_roster' /usr/lib/prosody/core/rostermanager.lua:305: in function 'set_contact_pending_out' mod_roster_command.lua:44: in function 'subscribe'
author Boris Grozev <boris@jitsi.org>
date Tue, 05 Jan 2021 13:15:00 -0600
parents 95882b487ed2
children 83f89ffe427b
line wrap: on
line source

# Introduction

This module adds an internal Prosody API to retrieve the last displayed message by MUC occupants.

## Requirements

The clients must support XEP-0333, and the users to be tracked must be affiliated with the room.

Currently due to lack of clarity about which id to use in acknowledgements in XEP-0333, this module
rewrites the id attribute of stanzas to match the stanza (archive) id assigned by the MUC server.

Oh yeah, and mod_muc_mam is required (or another module that adds a stanza-id), otherwise this module
won't do anything.

# Configuring

## Enabling

``` {.lua}
Component "rooms.example.net" "muc"
modules_enabled = {
    "muc_markers";
    "muc_mam";
}
```

## Settings

| Name            | Description                                                  | Default    |
|-----------------|--------------------------------------------------------------|------------|
| muc_marker_type | The type of marker to track (displayed/received/acknowledged)| "displayed"|

# Developers

## Example usage

```
local muc_markers = module:depends("muc_markers");

function something()
	local last_displayed_id = muc_markers.get_user_read_marker("user@localhost", "room@conference.localhost");
end
```