Merge branch 'staging' of github.com:xwiki-labs/cryptpad into staging

pull/1/head
ansuz 5 years ago
commit 58193a1969

@ -1969,7 +1969,11 @@ define([
first = false;
}
msg = msg.replace(/cp\|(([A-Za-z0-9+\/=]+)\|)?/, '');
msgs.push(msg);
msgs.push({
msg: msg,
author: parsed[2][1],
time: parsed[2][5]
});
}
};

@ -70,7 +70,11 @@ define([
if (!Array.isArray(data.messages)) { return void console.error('Not an array!'); }
lastKnownHash = data.lastKnownHash;
isComplete = data.isFull;
Array.prototype.unshift.apply(allMessages, data.messages); // Destructive concat
var messages = (data.messages || []).map(function (obj) {
return obj.msg;
});
if (config.debug) { console.log(data.messages); }
Array.prototype.unshift.apply(allMessages, messages); // Destructive concat
fillChainPad(realtime, allMessages);
cb (null, realtime, data.isFull);
});

@ -859,10 +859,14 @@ define([
}, function (data) {
cb({
isFull: data.isFull,
messages: data.messages.map(function (msg) {
messages: data.messages.map(function (obj) {
// The 3rd parameter "true" means we're going to skip signature validation.
// We don't need it since the message is already validated serverside by hk
return crypto.decrypt(msg, true, true);
return {
msg: crypto.decrypt(obj.msg, true, true),
author: obj.author,
time: obj.time
};
}),
lastKnownHash: data.lastKnownHash
});

@ -111,10 +111,13 @@ define([
}
};
exp.removeCursors = function () {
exp.removeCursors = function (inner) {
for (var id in cursors) {
deleteCursor(id);
}
// If diffdom has changed the cursor element somehow, we'll have cursor elements
// in the dom but not in memory: remove them
$(inner).find('.cp-cursor-position').remove();
};
exp.cursorGetter = function (hjson) {

@ -665,7 +665,7 @@ define([
// We have to remove the cursors before getting the content because they split
// the text nodes and OT/ChainPad would freak out
cursors.removeCursors();
cursors.removeCursors(inner);
displayMediaTags(framework, inner, mediaTagMap);
inner.normalize();

Loading…
Cancel
Save