Commit fdb24122 authored by JC Brand's avatar JC Brand

chatboxes: clear messages when in untrusted mode

parent 1c7c2509
......@@ -1396,6 +1396,13 @@ converse.plugins.add('converse-chatboxes', {
_converse.api.trigger('chatBoxesInitialized');
});
_converse.api.listen.on('clearSession', () => {
if (_converse.shouldClearCache()) {
_converse.chatboxes.filter(c => c.messages && c.messages.clearSession({'silent': true}));
}
});
_converse.api.listen.on('presencesInitialized', (reconnecting) => _converse.chatboxes.onConnected(reconnecting));
_converse.api.listen.on('reconnected', () => _converse.chatboxes.forEach(m => m.onReconnection()));
/************************ END Event Handlers ************************/
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment