For chatboxes, use the web storage determined by _converse.trusted

This commit is contained in:
JC Brand 2019-06-18 16:46:55 +02:00
parent 55f7183f36
commit 1dc73c1c31

View File

@ -311,7 +311,6 @@ converse.plugins.add('converse-chatboxes', {
initMessages () { initMessages () {
this.messages = new _converse.Messages(); this.messages = new _converse.Messages();
const storage = _converse.config.get('storage');
this.messages.browserStorage = new BrowserStorage.session( this.messages.browserStorage = new BrowserStorage.session(
`converse.messages-${this.get('jid')}-${_converse.bare_jid}`); `converse.messages-${this.get('jid')}-${_converse.bare_jid}`);
this.messages.chatbox = this; this.messages.chatbox = this;
@ -1001,7 +1000,8 @@ converse.plugins.add('converse-chatboxes', {
}, },
onConnected () { onConnected () {
this.browserStorage = new BrowserStorage.session( const storage = _converse.config.get('storage');
this.browserStorage = new BrowserStorage[storage](
`converse.chatboxes-${_converse.bare_jid}`); `converse.chatboxes-${_converse.bare_jid}`);
this.registerMessageHandler(); this.registerMessageHandler();
this.fetch({ this.fetch({