It's the only way I could get a failing test (due to the Jasmine upgrade AFAIK) to pass.
I don't understand why this happens, given that the promise has a
`catch` clause in `retractOwnMessage`, but for some reason the promise
rejection gets caught by Jasmine, causing the test to fail.
The disco entities collection gets recreated and repopulated every time
the connection is re-established or after the user logs in again after
having logged out.
The old disco entities weren't being removed, due to an erroneous
`shouldClearCache` call (not applicable to sessionStorage data).
In addition we need a handler to fire and clear the entities cache when
Converse is going to restart.
This prevents it from being persisted across page loads and makes more
sense logically.
Also move markScrolled to utils and MUC unread messages indicator to bottom panel.
If set to a positive integer, the chat history will be kept to that size
by removing older messages.
This happens as new messages come in (as long as the chat isn't scrolled up)
and when the user scrolls down.
Also add the `pruning_behavior` setting
More work on making bottom panel sub-components declarative
- Handle auto-completion in the converse-muc-message-form element
- Make message limit indicator a component
- Rename template
This causes an empty bookmarks list in the controlbox, because the
collection gets cleared (and then asynchronousy repopulated) while the
`bookmarksInitialized` promise stays `true` (resulting in a race
condition).
Alternative fix could be to clear the bookmarks and recreate the promise
before reconnecting but doesn't seem necessary to do all that work.
This required triggering the `converse-loaded` event in the entry.js
file, which means it won't be triggered for `@converse/headless` when
used in isolation.
Not ideal, but probably ok because consumers of `@converse/headless`
should probably import it into their own project in any case.