|
|
@ -54,29 +54,6 @@ define([
|
|
|
|
});
|
|
|
|
});
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
var cpIndex = 0;
|
|
|
|
|
|
|
|
var sortedCp;
|
|
|
|
|
|
|
|
if (config.onlyoffice) {
|
|
|
|
|
|
|
|
sortedCp = Object.keys(config.onlyoffice).map(Number).sort(function (a, b) {
|
|
|
|
|
|
|
|
return a-b;
|
|
|
|
|
|
|
|
});
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
var loadMoreOOHistory = function () {
|
|
|
|
|
|
|
|
if (!Array.isArray(sortedCp)) {
|
|
|
|
|
|
|
|
return void console.error("Wrong type");
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
var hashes = config.onlyoffice;
|
|
|
|
|
|
|
|
if (!sortedCp.length) {
|
|
|
|
|
|
|
|
// XXX no cp
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
var cp = {};
|
|
|
|
|
|
|
|
if (cpIndex < sortedCp.length) {
|
|
|
|
|
|
|
|
var idx = sortedCp[sortedCp.length - 1 - cpIndex];
|
|
|
|
|
|
|
|
cp = config.onlyoffice[idx];
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
config.onLocal(cp);
|
|
|
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
var allMessages = [];
|
|
|
|
var allMessages = [];
|
|
|
|
var lastKnownHash;
|
|
|
|
var lastKnownHash;
|
|
|
|
var isComplete = false;
|
|
|
|
var isComplete = false;
|
|
|
@ -357,10 +334,6 @@ define([
|
|
|
|
config.onOpen();
|
|
|
|
config.onOpen();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
if (config.onlyoffice) {
|
|
|
|
|
|
|
|
return void loadMoreOOHistory();
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// Load all the history messages into a new chainpad object
|
|
|
|
// Load all the history messages into a new chainpad object
|
|
|
|
loadMoreHistory(config, common, function (err, newRt, isFull) {
|
|
|
|
loadMoreHistory(config, common, function (err, newRt, isFull) {
|
|
|
|
History.readOnly = common.getMetadataMgr().getPrivateData().readOnly;
|
|
|
|
History.readOnly = common.getMetadataMgr().getPrivateData().readOnly;
|
|
|
|