Please show me how conversejs can get the message stored in indexedDb by plugin if possible? I want to create my own chat history list interface because controlbox is not suitable for my business.
Please show me how conversejs can get the message stored in indexedDb by plugin if possible? I want to create my own chat history list interface because controlbox is not suitable for my business.
The messages are stored in a Collection which is set as the messages attribute on the ChatBox model. A ChatBox represents the Chat conversation with a particular contact.
converse.plugins.add("my-plugin", {
initialize() {
const { api } = this._converse;
const chat = api.chats.get('contact@example.org');
// log all messages to the console
chat.messages.forEach(m => console.log(m.get('body'));
}
});