Commit 94bea16c authored by JC Brand's avatar JC Brand

Remove `chatBoxOpened` event

parent d1572f35
...@@ -406,7 +406,7 @@ ...@@ -406,7 +406,7 @@
await test_utils.waitUntil(() => _converse.chatboxes.length == 7) await test_utils.waitUntil(() => _converse.chatboxes.length == 7)
expect(_converse.chatboxviews.trimChats).toHaveBeenCalled(); expect(_converse.chatboxviews.trimChats).toHaveBeenCalled();
expect(_converse.chatboxes.length).toEqual(7); expect(_converse.chatboxes.length).toEqual(7);
expect(_converse.api.trigger).toHaveBeenCalledWith('chatBoxOpened', jasmine.any(Object)); expect(_converse.api.trigger).toHaveBeenCalledWith('chatBoxInitialized', jasmine.any(Object));
test_utils.closeAllChatBoxes(_converse); test_utils.closeAllChatBoxes(_converse);
expect(_converse.chatboxes.length).toEqual(1); expect(_converse.chatboxes.length).toEqual(1);
......
...@@ -935,7 +935,7 @@ ...@@ -935,7 +935,7 @@
'id': (new Date()).getTime() 'id': (new Date()).getTime()
}).c('body').t('😇').up() }).c('body').t('😇').up()
.c('active', {'xmlns': 'http://jabber.org/protocol/chatstates'}).tree()); .c('active', {'xmlns': 'http://jabber.org/protocol/chatstates'}).tree());
await new Promise(resolve => _converse.on('chatBoxOpened', resolve)); await new Promise(resolve => _converse.on('chatBoxInitialized', resolve));
const view = _converse.api.chatviews.get(sender_jid); const view = _converse.api.chatviews.get(sender_jid);
await new Promise((resolve, reject) => view.once('messageInserted', resolve)); await new Promise((resolve, reject) => view.once('messageInserted', resolve));
...@@ -1084,7 +1084,7 @@ ...@@ -1084,7 +1084,7 @@
'id': (new Date()).getTime() 'id': (new Date()).getTime()
}).c('body').t('A message').up() }).c('body').t('A message').up()
.c('active', {'xmlns': 'http://jabber.org/protocol/chatstates'}).tree()); .c('active', {'xmlns': 'http://jabber.org/protocol/chatstates'}).tree());
await new Promise(resolve => _converse.on('chatBoxOpened', resolve)); await new Promise(resolve => _converse.on('chatBoxInitialized', resolve));
const view = _converse.api.chatviews.get(sender_jid); const view = _converse.api.chatviews.get(sender_jid);
await new Promise((resolve, reject) => view.once('messageInserted', resolve)); await new Promise((resolve, reject) => view.once('messageInserted', resolve));
......
...@@ -349,7 +349,6 @@ converse.plugins.add('converse-chatview', { ...@@ -349,7 +349,6 @@ converse.plugins.add('converse-chatview', {
this.render(); this.render();
this.fetchMessages(); this.fetchMessages();
_converse.api.trigger('chatBoxOpened', this); // TODO: remove
/** /**
* Triggered once the _converse.ChatBoxView has been initialized * Triggered once the _converse.ChatBoxView has been initialized
* @event _converse#chatBoxInitialized * @event _converse#chatBoxInitialized
......
...@@ -89,7 +89,6 @@ converse.plugins.add('converse-headline', { ...@@ -89,7 +89,6 @@ converse.plugins.add('converse-headline', {
this.model.on('change:minimized', this.onMinimizedChanged, this); this.model.on('change:minimized', this.onMinimizedChanged, this);
this.render().insertHeading().fetchMessages().insertIntoDOM().hide(); this.render().insertHeading().fetchMessages().insertIntoDOM().hide();
_converse.api.trigger('chatBoxOpened', this); // TODO: remove
_converse.api.trigger('chatBoxInitialized', this); _converse.api.trigger('chatBoxInitialized', this);
}, },
......
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