Commit 450ce04f authored by JC Brand's avatar JC Brand

Refactor chat rooms.

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).
parent e59071ae
This diff is collapsed.
......@@ -67,6 +67,7 @@ config = {
"chatarea": "src/templates/chatarea",
"chatbox": "src/templates/chatbox",
"chatroom": "src/templates/chatroom",
"chatroom_sidebar": "src/templates/chatroom_sidebar",
"chatrooms_tab": "src/templates/chatrooms_tab",
"chats_panel": "src/templates/chats_panel",
"choose_status": "src/templates/choose_status",
......
......@@ -7,6 +7,7 @@ define("converse-templates", [
"tpl!chatarea",
"tpl!chatbox",
"tpl!chatroom",
"tpl!chatroom_sidebar",
"tpl!chatrooms_tab",
"tpl!chats_panel",
"tpl!choose_status",
......@@ -50,38 +51,39 @@ define("converse-templates", [
chatarea: arguments[5],
chatbox: arguments[6],
chatroom: arguments[7],
chatrooms_tab: arguments[8],
chats_panel: arguments[9],
choose_status: arguments[10],
contacts_panel: arguments[11],
contacts_tab: arguments[12],
controlbox: arguments[13],
controlbox_toggle: arguments[14],
field: arguments[15],
form_checkbox: arguments[16],
form_input: arguments[17],
form_select: arguments[18],
group_header: arguments[19],
info: arguments[20],
login_panel: arguments[21],
login_tab: arguments[22],
message: arguments[23],
new_day: arguments[24],
occupant: arguments[25],
pending_contact: arguments[26],
pending_contacts: arguments[27],
requesting_contact: arguments[28],
requesting_contacts: arguments[29],
room_description: arguments[30],
room_item: arguments[31],
room_panel: arguments[32],
roster: arguments[33],
roster_item: arguments[34],
select_option: arguments[35],
search_contact: arguments[36],
status_option: arguments[37],
toggle_chats: arguments[38],
toolbar: arguments[39],
trimmed_chat: arguments[40]
chatroom_sidebar: arguments[8],
chatrooms_tab: arguments[9],
chats_panel: arguments[10],
choose_status: arguments[11],
contacts_panel: arguments[12],
contacts_tab: arguments[13],
controlbox: arguments[14],
controlbox_toggle: arguments[15],
field: arguments[16],
form_checkbox: arguments[17],
form_input: arguments[18],
form_select: arguments[19],
group_header: arguments[20],
info: arguments[21],
login_panel: arguments[22],
login_tab: arguments[23],
message: arguments[24],
new_day: arguments[25],
occupant: arguments[26],
pending_contact: arguments[27],
pending_contacts: arguments[28],
requesting_contact: arguments[29],
requesting_contacts: arguments[30],
room_description: arguments[31],
room_item: arguments[32],
room_panel: arguments[33],
roster: arguments[34],
roster_item: arguments[35],
select_option: arguments[36],
search_contact: arguments[37],
status_option: arguments[38],
toggle_chats: arguments[39],
toolbar: arguments[40],
trimmed_chat: arguments[41]
};
});
......@@ -8,10 +8,3 @@
placeholder="{{label_message}}"/>
</form>
</div>
<div class="participants">
<form class="room-invite">
<input class="invited-contact" placeholder="{{label_invitation}}" type="text"/>
</form>
<label>Participants:</label>
<ul class="participant-list"></ul>
</div>
<!-- <div class="participants"> -->
<form class="room-invite">
<input class="invited-contact" placeholder="{{label_invitation}}" type="text"/>
</form>
<label>{{label_occupants}}:</label>
<ul class="participant-list"></ul>
<!-- </div> -->
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment