File tree 2 files changed +9
-2
lines changed
2 files changed +9
-2
lines changed Original file line number Diff line number Diff line change @@ -69,6 +69,7 @@ function emitCheck(note) {
69
69
authors : note . authors ,
70
70
authorship : note . authorship
71
71
} ;
72
+ out = LZString . compressToUTF16 ( JSON . stringify ( out ) ) ;
72
73
realtime . io . to ( note . id ) . emit ( 'check' , out ) ;
73
74
}
74
75
@@ -310,7 +311,7 @@ function emitRefresh(socket) {
310
311
var noteId = socket . noteId ;
311
312
if ( ! noteId || ! notes [ noteId ] ) return ;
312
313
var note = notes [ noteId ] ;
313
- socket . emit ( 'refresh' , {
314
+ var out = {
314
315
docmaxlength : config . documentmaxlength ,
315
316
owner : note . owner ,
316
317
ownerprofile : note . ownerprofile ,
@@ -321,7 +322,9 @@ function emitRefresh(socket) {
321
322
permission : note . permission ,
322
323
createtime : note . createtime ,
323
324
updatetime : note . updatetime
324
- } ) ;
325
+ } ;
326
+ out = LZString . compressToUTF16 ( JSON . stringify ( out ) ) ;
327
+ socket . emit ( 'refresh' , out ) ;
325
328
}
326
329
327
330
function clearSocketQueue ( queue , socket ) {
Original file line number Diff line number Diff line change @@ -2360,6 +2360,8 @@ editor.on('update', function () {
2360
2360
} ) ;
2361
2361
} ) ;
2362
2362
socket . on ( 'check' , function ( data ) {
2363
+ data = LZString . decompressFromUTF16 ( data ) ;
2364
+ data = JSON . parse ( data ) ;
2363
2365
//console.log(data);
2364
2366
updateLastInfo ( data ) ;
2365
2367
} ) ;
@@ -2371,6 +2373,8 @@ var otk = null;
2371
2373
var owner = null ;
2372
2374
var permission = null ;
2373
2375
socket . on ( 'refresh' , function ( data ) {
2376
+ data = LZString . decompressFromUTF16 ( data ) ;
2377
+ data = JSON . parse ( data ) ;
2374
2378
//console.log(data);
2375
2379
docmaxlength = data . docmaxlength ;
2376
2380
editor . setOption ( "maxLength" , docmaxlength ) ;
You can’t perform that action at this time.
0 commit comments