Commit 219d5c8a authored by JC Brand's avatar JC Brand

Major refactor.

The RosterView view is now an overview of RosterGroup objects.

RosterGroup objects each have their own collection of contacts which fall under that group.
Additionally, the RosterView has a collection of all contacts.

The comparator of RosterContacts is now used to correctly position roster
contacts and we therefore no longer need to explicitly sort them afterwards.

updates #83
updates #151
parent ca260f7b
This diff is collapsed.
......@@ -13,7 +13,7 @@
runs(function () {
utils.closeAllChatBoxes();
utils.removeControlBox();
converse.roster.browserStorage._clear();
utils.clearBrowserStorage();
utils.initConverse();
utils.createContacts();
utils.openControlBox();
......@@ -682,7 +682,7 @@
beforeEach(function () {
utils.closeAllChatBoxes();
utils.removeControlBox();
converse.roster.browserStorage._clear();
converse.rosterview.roster.browserStorage._clear();
utils.initConverse();
utils.createContacts();
utils.openControlBox();
......
This diff is collapsed.
......@@ -13,7 +13,7 @@
runs(function () {
utils.closeAllChatBoxes();
utils.removeControlBox();
converse.roster.browserStorage._clear();
converse.rosterview.roster.browserStorage._clear();
utils.initConverse();
utils.createContacts();
utils.openControlBox();
......
......@@ -36,7 +36,7 @@
};
utils.initRoster = function () {
converse.roster.browserStorage._clear();
converse.rosterview.roster.browserStorage._clear();
converse.initRoster();
};
......@@ -80,13 +80,13 @@
var i = 0, jid, views = [];
for (i; i<amount; i++) {
jid = mock.cur_names[i].replace(/ /g,'.').toLowerCase() + '@localhost';
views[i] = converse.roster.get(jid).trigger("open");
views[i] = converse.rosterview.roster.get(jid).trigger("open");
}
return views;
};
utils.openChatBoxFor = function (jid) {
return converse.roster.get(jid).trigger("open");
return converse.rosterview.roster.get(jid).trigger("open");
};
utils.removeRosterContacts = function () {
......@@ -134,7 +134,7 @@
ask = null;
}
for (i=0; i<names.length; i++) {
converse.roster.create({
converse.rosterview.roster.create({
ask: ask,
fullname: names[i],
is_last: i===(names.length-1),
......
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