xmpp.chapril.org-conversejs/src/plugins/mam-views/index.js
JC Brand dc711d494f Add a placeholder to indicate a gap in the message history
The user can click the placeholder to fill in the gap.
2021-06-17 11:35:06 +02:00

19 lines
617 B
JavaScript

/**
* @description UI code XEP-0313 Message Archive Management
* @copyright 2021, the Converse.js contributors
* @license Mozilla Public License (MPLv2)
*/
import './placeholder.js';
import { api, converse } from '@converse/headless/core';
import { fetchMessagesOnScrollUp, getPlaceholderTemplate } from './utils.js';
converse.plugins.add('converse-mam-views', {
dependencies: ['converse-mam', 'converse-chatview', 'converse-muc-views'],
initialize () {
api.listen.on('chatBoxScrolledUp', fetchMessagesOnScrollUp);
api.listen.on('getMessageTemplate', getPlaceholderTemplate);
}
});