Fix minimizing by listening to change event
Fixes around showing/hiding and minimizing/maximizing
Don't trigger a `show` event on the model to show a chat, instead rely
on the `hidden` attribute which causes a rerender and will show/hide
chats.
The eventual goal is to avoid UI-related stanza processing if the relevant chats
aren't in the DOM.
With the current architecture, chatboxes are created (and the stanzas
related to them processed) even if `#conversejs` isn't in the DOM.
* Initial work on making controlbox an element
* Create a shared base class
* Ceate ChatBoxViews proxy
* Update sass now that certain classes are moved to converse-chats element
In some cases a race condition can occur where a new message is received
before the MAM query starts.
Previously, the newly received message would be considered the latest
message to query from, thereby causing a gap in the history.
This causes index offset issues with any rich elements in the message.
We could try to fix the offsets, or alternatively replace the collapsed
newlines with spaces (to maintain the original offsets), but I don't
think it's worth the effort since I'm not sure that it's a good idea to
collapse newlines in the first place.
Looking at the Prosody code, it appears to be cheap since
Prosody will do nothing if you're already registered and this works
around a bug in mod_muc_rai where events aren't fired for each resource
of the same joined nick joining or leaving the MUC.
When a MUC starts out hidden, we first need to join in order to find out
whether we're affiliated before we can know whether we should enable RAI
or join the MUC as usual.
- Add test for incoming RAI message
- Only enable RAI if the user is affilated in MUC being left
- Handle error presence indicating a resouce-constraint
- Don't unregister stanza handlers in `leave`, since we still want to
listen to RAI-related stanzas. Instead unregister upon the `destroy`
event.