* Make sure to rebroadcast presence when logging in after having just
logged out.
* Remove roster contacts when logging out, to avoid artifacts when logging in
with a different account.
The tpl configuration in main.js is only for externally loaded templates, if we
use inline templates (as is the case with the room invite feature), we need to
configure _.templateSettings as well.
Looks like the subsription flow was broken since the roster groups refactor.
Requesting and pending contacts weren't being properly added to (and removed
from) roster groups.
Requesting contacts are now properly added and remove. Next up, handling
outgoing requets (i.e. pending contacts).
When loading a page with an existing session, the roster view's elements were
being added too early, resulting in event handlers not being properly
registered.
When re-attaching to an existing session, chat rooms are fetched from
sessionStorage and we join them again.
However, unless we send a presence of type unavailable before reloading the
page, from the XMPP server's perspective we never left the chat room.
It therefore doesn't send us again the room occupants or room messages.
To send a presence of type unavailable is a hack and not desireable. Rather, we
want to stay in the room and just re-attach to it upon page reload.
In order to do this, we need some new functionality.
* Refactor the chat room sidebar into a new Backbone Model/View combo. (done).
* Store/fetch room occupants in/from sessionStorage (done).
* Store/fetch room messages in/from sessionStorage (not yet done).
* Instead of re-joining a chat room which we never left, just register the event handlers again. (not yet done).
onChatRoomPresence and showStatusMessages have been refactored to give more
detailed information and to also show the reasons given to actions taken by
moderators.