I've configured Conversejs to Auto join a room, with a preconfigured account and credentials. I would like it to clear the previous messages when the room is joined.
I've been able to put together this shell of a plugin, and have confirmed it executes but dont know the code to clear the chat text.
converse.plugins.add('myplugin', {
initialize: function () {
this._converse.api.listen.on('roomsAutoJoined', () => {
// How to clear chat ??
});
}
});
Basicically executing the /clear command for the user automatically when joining room. There will always be another user signed into the room, or else I know it would clear automatically. Also I'm using ejabberd if it matters.