mirror of
https://github.com/hedgedoc/hedgedoc.git
synced 2025-05-12 22:26:08 -04:00
Remove LZString compression for data storage
This commit is contained in:
parent
c904083d1f
commit
f6d8e3ab00
5 changed files with 28 additions and 37 deletions
|
@ -152,12 +152,10 @@ function finishUpdateNote(note, _note, callback) {
|
|||
if (!note || !note.server) return callback(null, null);
|
||||
var body = note.server.document;
|
||||
var title = note.title = models.Note.parseNoteTitle(body);
|
||||
title = LZString.compressToBase64(title);
|
||||
body = LZString.compressToBase64(body);
|
||||
var values = {
|
||||
title: title,
|
||||
content: body,
|
||||
authorship: LZString.compressToBase64(JSON.stringify(note.authorship)),
|
||||
authorship: note.authorship,
|
||||
lastchangeuserId: note.lastchangeuser,
|
||||
lastchangeAt: Date.now()
|
||||
};
|
||||
|
@ -459,7 +457,7 @@ function startConnection(socket) {
|
|||
var lastchangeuser = note.lastchangeuserId;
|
||||
var lastchangeuserprofile = note.lastchangeuser ? models.User.getProfile(note.lastchangeuser) : null;
|
||||
|
||||
var body = LZString.decompressFromBase64(note.content);
|
||||
var body = note.content;
|
||||
var createtime = note.createdAt;
|
||||
var updatetime = note.lastchangeAt;
|
||||
var server = new ot.EditorSocketIOServer(body, [], noteId, ifMayEdit, operationCallback);
|
||||
|
@ -479,7 +477,7 @@ function startConnection(socket) {
|
|||
notes[noteId] = {
|
||||
id: noteId,
|
||||
alias: note.alias,
|
||||
title: LZString.decompressFromBase64(note.title),
|
||||
title: note.title,
|
||||
owner: owner,
|
||||
ownerprofile: ownerprofile,
|
||||
permission: note.permission,
|
||||
|
@ -491,7 +489,7 @@ function startConnection(socket) {
|
|||
updatetime: moment(updatetime).valueOf(),
|
||||
server: server,
|
||||
authors: authors,
|
||||
authorship: note.authorship ? JSON.parse(LZString.decompressFromBase64(note.authorship)) : []
|
||||
authorship: note.authorship
|
||||
};
|
||||
|
||||
return finishConnection(socket, notes[noteId], users[socket.id]);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue