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.
Fixes an issue whereby those tokens are passed in but not used and instead
converse attempts to restore the session (and then totally ignores the tokens
when it fails).
Makes sense to me that you'd want your passed in tokens to be used always, even
when there are restorable tokens.
Don't call trimChats when the box is minimized or maximized, instead call it
only when the minimized chats toggle appears or disappears, since that's the
element that adds/removes space.
Also, a fix. 'onShow' has been renamed to 'onMaximized'
In the process refactored the code being tested.
- Move notifications code in MUC to src/converse-notification.js
- Trigger the 'contactStatusChanged' event in RosterContact and not in
ChatBoxView (which might not exist).
Don't make the event "this" context the protected converse object.
Can't trigger multiple data parameters, need to pass an object if there are
multiple values to be sent.
Also fixed an issue w.r.t the plugin architecture. Previously infinite
recursion would happen when more than one plugin was overriding a method.
Resolved now by using a wrapper function that lazily sets the correct super
method.
The __ translate method should only be run *after* converse.js has been
initialized and we know what the actual desired language is
Also fix bug in src/locales.js where wrong langs were assigned to wrong keys.