implement 'getCanonicalChannelList'

pull/1/head
ansuz 8 years ago
parent 09f8e139fe
commit e4b15bc616

@ -205,7 +205,7 @@ define([
return hexArray.join(""); return hexArray.join("");
}; };
var deduplicate = common.deduplicateString = function (array) { var deduplicateString = common.deduplicateString = function (array) {
var a = array.slice(); var a = array.slice();
for(var i=0; i<a.length; i++) { for(var i=0; i<a.length; i++) {
for(var j=i+1; j<a.length; j++) { for(var j=i+1; j<a.length; j++) {
@ -215,6 +215,9 @@ define([
return a; return a;
}; };
var getCanonicalChannelList = common.getCanonicalChannelList = function () {
return deduplicateString(getUserChannelList()).sort();
};
var parseHash = common.parseHash = function (hash) { var parseHash = common.parseHash = function (hash) {
var parsed = {}; var parsed = {};

@ -11,8 +11,7 @@ define([
var synchronize = function (call) { var synchronize = function (call) {
// provide a sorted list of unique channels // provide a sorted list of unique channels
var list = Cryptpad.deduplicateString(Cryptpad.getUserChannelList()) var list = Cryptpad.getCanonicalChannelList();
.sort();
var localHash = call.hashChannelList(list); var localHash = call.hashChannelList(list);
var serverHash; var serverHash;

Loading…
Cancel
Save