Skip to content

Commit d6d2cf9

Browse files
committed
Update to send note title on emit check and refresh event
1 parent 36a1900 commit d6d2cf9

1 file changed

Lines changed: 4 additions & 1 deletion

File tree

lib/realtime.js

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,7 @@ function secure(socket, next) {
6464

6565
function emitCheck(note) {
6666
var out = {
67+
title: note.title,
6768
updatetime: note.updatetime,
6869
lastchangeuser: note.lastchangeuser,
6970
lastchangeuserprofile: note.lastchangeuserprofile,
@@ -149,7 +150,7 @@ function updateNote(note, callback) {
149150
function finishUpdateNote(note, _note, callback) {
150151
if (!note || !note.server) return callback(null, null);
151152
var body = note.server.document;
152-
var title = models.Note.parseNoteTitle(body);
153+
var title = note.title = models.Note.parseNoteTitle(body);
153154
title = LZString.compressToBase64(title);
154155
body = LZString.compressToBase64(body);
155156
var values = {
@@ -313,6 +314,7 @@ function emitRefresh(socket) {
313314
if (!noteId || !notes[noteId]) return;
314315
var note = notes[noteId];
315316
var out = {
317+
title: note.title,
316318
docmaxlength: config.documentmaxlength,
317319
owner: note.owner,
318320
ownerprofile: note.ownerprofile,
@@ -476,6 +478,7 @@ function startConnection(socket) {
476478
notes[noteId] = {
477479
id: noteId,
478480
alias: note.alias,
481+
title: LZString.decompressFromBase64(note.title),
479482
owner: owner,
480483
ownerprofile: ownerprofile,
481484
permission: note.permission,

0 commit comments

Comments
 (0)