Remove interval handler and the user activity handler.
Make sure the connection is reset when logging out.
Also removed the reconnectTimeout, instead debounce the reconnect method by 1 second.
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.
and auto_login is true and credentials_url is set.
Trying to handle the case where tokens are used for credentials_url (and the
token is expired).
Not yet 100% happy with this implementation.
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.
Couldn't handle messages with no "from" attribute.
Some refactoring to add code that checks if a messages is a headline to the
utils module.
Updated tests. Add sinon so that we can test returned value of spy.