ejabberd: Set mod_mam default to always

This helps various clients to use MAM.

Fixes: #2338

Tests:

- Functional tests for ejabberd pass.

- Install ejabberd and enable MAM. Check that default is set to always
  in the configuration.

- Without this change, install ejabberd and enable MAM. Then restart
  plinth with this change. The configuration is changed from never to
  always. After several minutes, ejabberd is running again.

Signed-off-by: James Valleroy <jvalleroy@mailbox.org>
Reviewed-by: Sunil Mohan Adapa <sunil@medhas.org>
This commit is contained in:
James Valleroy 2024-10-12 07:24:34 -04:00 committed by Sunil Mohan Adapa
parent a87c3b102e
commit 33b41a66c3
No known key found for this signature in database
GPG Key ID: 43EA1CFF0AA7C5F2
2 changed files with 6 additions and 2 deletions

View File

@ -50,7 +50,7 @@ class EjabberdApp(app_module.App):
app_id = 'ejabberd'
_version = 8
_version = 9
def __init__(self) -> None:
"""Create components for the app."""
@ -159,6 +159,10 @@ class EjabberdApp(app_module.App):
'turn-ejabberd').get_configuration()
update_turn_configuration(configuration, force=True)
if old_version and old_version < 9 and privileged.mam('status'):
# Re-enable to change configuration
privileged.mam('enable')
class EjabberdTurnConsumer(TurnConsumer):
"""Component to manage Coturn configuration for ejabberd."""

View File

@ -261,7 +261,7 @@ def mam(command: str) -> bool | None:
'mod_mam': {
'db_type':
'mnesia', # default is 'mnesia' (w/o set default_db)
'default': 'never', # policy, default 'never'
'default': 'always', # helps various clients to use mam
'request_activates_archiving': False, # default False
'assume_mam_usage': False, # for non-ack'd msgs, default False
'cache_size': 1000, # default is 1000 items