* Consistent unread messages count updating on ChatBoxView, Minimized ChatBoxView, RosterView and page's title
* Add tests for checking unread messages count updates in different GUI parts
* Update docs/CHANGES.md
* document windowStateChanged event in events.rst
What started as an attempt to fix a bug in parseXUserElement, turned into
another large refactoring of MUC code, and it's not clear how to break this up
into multiple atomic commits. So I'm just pushing it all.
At least there are two new tests added to the suite.
Bug got introduced during fix for #677
Eventually had to do a significant refactoring, to more consistently use the
`hidden` class instead of `display: None`. (relevant for #695)
This change refactors out the plugin code from converse-core into
src/converse-puggable.js
Additionally, plugins now have an optional attribute `optional_dependencies`
which is an array of dependencies which are "nice-to-have" but not essential.
Work has also been done to ensure that a plugins' dependencies are first loaded
before the plugin itself.
Otherwise maximized chats are scrolled to the top, showing the oldest messages.
Ideally we'd probably like to remember the scroll position, and show that, but
this would require some significant refactoring.
Otherwise the hide event can prevent a consecutive show event.
This bug becomes apparent when maximizing a minimized chat in a screen with not
enough space.
Another box will have to be minimized, which causes first a hide and then a
show event on the minimized chats toggle.
- Don't call show in a room's initialize method (instead let the code be more
similar to normal chats, in that it should listen to the "show" trigger).
- Rename chatBoxShouldBeShown to chatBoxMayBeShown
- Implement auto_join for rooms only once boxes have been fetched already.
Don't call trimChats in onChatBoxAdded event. Reduntant because it will be
called after maximization and after being shown.
Add new method getShownChats and don't trim if only one or zero chats are being
shown.
Don't trim chats when in responsive mode.
Don't call trimChats unnecessarily in the render method of the trimmed chats
thingy.
Previously views were only hidden, but not removed. This was an unnecessary
"optimization" which introduced unnecessary complexity.
Problem solved was that closing minimized chats didn't dereference the model
for hidden "normal" chat views, causing an exception to be raised when trying
to log out.