summaryrefslogtreecommitdiff
path: root/lib/realtime.js
diff options
context:
space:
mode:
authorWu Cheng-Han2017-01-02 10:59:53 +0800
committerWu Cheng-Han2017-01-02 10:59:53 +0800
commitf6d8e3ab00370a78c0c788ad1e37a7ff77a53555 (patch)
treec5bc7cf24ba0022893a2992d25d90280c38fa1d9 /lib/realtime.js
parentc904083d1f5064d2e786e0bc6ee3804b91805d24 (diff)
Remove LZString compression for data storage
Diffstat (limited to 'lib/realtime.js')
-rw-r--r--lib/realtime.js10
1 files changed, 4 insertions, 6 deletions
diff --git a/lib/realtime.js b/lib/realtime.js
index c66fea0a..a662deeb 100644
--- a/lib/realtime.js
+++ b/lib/realtime.js
@@ -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]);