From 6d7a8199ae5ebc21b7276eeff685961cbb13c70b Mon Sep 17 00:00:00 2001 From: John Livingston Date: Thu, 21 Dec 2023 16:01:29 +0100 Subject: [PATCH] Fix #140:using ConverseJS `prune_messages_above` to purge old messages, keeping only last 100. --- CHANGELOG.md | 3 ++- conversejs/lib/converse-params.ts | 5 ++++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 125e04e9..5015aed5 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,7 +4,8 @@ ### Minor changes and fixes -* Updated spanish translations +* Updated spanish translations. +* ConverseJS: using `prune_messages_above` to purge old messages, keeping only last 100 (Fix #140). ## 8.0.3 diff --git a/conversejs/lib/converse-params.ts b/conversejs/lib/converse-params.ts index 87be89e6..3e59ea21 100644 --- a/conversejs/lib/converse-params.ts +++ b/conversejs/lib/converse-params.ts @@ -75,7 +75,10 @@ function defaultConverseParams ( whitelisted_plugins: ['livechatWindowTitlePlugin', 'livechatViewerModePlugin', 'livechatDisconnectOnUnloadPlugin'], show_retraction_warning: false, // No need to use this warning (except if we open to external clients?) muc_show_info_messages: mucShowInfoMessages, - send_chat_state_notifications: false // don't send this for performance reason + send_chat_state_notifications: false, // don't send this for performance reason + + prune_messages_above: 100, // only keep 100 message in history. + pruning_behavior: 'unscrolled' } // TODO: params.clear_messages_on_reconnection = true when muc_mam will be available.