diff options
author | Wu Cheng-Han | 2016-10-10 20:56:22 +0800 |
---|---|---|
committer | Wu Cheng-Han | 2016-10-10 20:56:22 +0800 |
commit | d6d2cf978aed8f7abeb93d0393c9d04a4a06bd4e (patch) | |
tree | 8be09b488a98acf110c3ab1304510ca00f229d74 /lib | |
parent | 36a1900ce3496f2d71ae4c41609dc52d24636be2 (diff) |
Update to send note title on emit check and refresh event
Diffstat (limited to 'lib')
-rw-r--r-- | lib/realtime.js | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/lib/realtime.js b/lib/realtime.js index a05c1f41..c6c9ffeb 100644 --- a/lib/realtime.js +++ b/lib/realtime.js @@ -64,6 +64,7 @@ function secure(socket, next) { function emitCheck(note) { var out = { + title: note.title, updatetime: note.updatetime, lastchangeuser: note.lastchangeuser, lastchangeuserprofile: note.lastchangeuserprofile, @@ -149,7 +150,7 @@ function updateNote(note, callback) { function finishUpdateNote(note, _note, callback) { if (!note || !note.server) return callback(null, null); var body = note.server.document; - var title = models.Note.parseNoteTitle(body); + var title = note.title = models.Note.parseNoteTitle(body); title = LZString.compressToBase64(title); body = LZString.compressToBase64(body); var values = { @@ -313,6 +314,7 @@ function emitRefresh(socket) { if (!noteId || !notes[noteId]) return; var note = notes[noteId]; var out = { + title: note.title, docmaxlength: config.documentmaxlength, owner: note.owner, ownerprofile: note.ownerprofile, @@ -476,6 +478,7 @@ function startConnection(socket) { notes[noteId] = { id: noteId, alias: note.alias, + title: LZString.decompressFromBase64(note.title), owner: owner, ownerprofile: ownerprofile, permission: note.permission, |