File tree Expand file tree Collapse file tree 2 files changed +9
-2
lines changed
Expand file tree Collapse file tree 2 files changed +9
-2
lines changed Original file line number Diff line number Diff line change @@ -69,6 +69,7 @@ function emitCheck(note) {
6969 authors : note . authors ,
7070 authorship : note . authorship
7171 } ;
72+ out = LZString . compressToUTF16 ( JSON . stringify ( out ) ) ;
7273 realtime . io . to ( note . id ) . emit ( 'check' , out ) ;
7374}
7475
@@ -310,7 +311,7 @@ function emitRefresh(socket) {
310311 var noteId = socket . noteId ;
311312 if ( ! noteId || ! notes [ noteId ] ) return ;
312313 var note = notes [ noteId ] ;
313- socket . emit ( 'refresh' , {
314+ var out = {
314315 docmaxlength : config . documentmaxlength ,
315316 owner : note . owner ,
316317 ownerprofile : note . ownerprofile ,
@@ -321,7 +322,9 @@ function emitRefresh(socket) {
321322 permission : note . permission ,
322323 createtime : note . createtime ,
323324 updatetime : note . updatetime
324- } ) ;
325+ } ;
326+ out = LZString . compressToUTF16 ( JSON . stringify ( out ) ) ;
327+ socket . emit ( 'refresh' , out ) ;
325328}
326329
327330function clearSocketQueue ( queue , socket ) {
Original file line number Diff line number Diff line change @@ -2360,6 +2360,8 @@ editor.on('update', function () {
23602360 } ) ;
23612361} ) ;
23622362socket . on ( 'check' , function ( data ) {
2363+ data = LZString . decompressFromUTF16 ( data ) ;
2364+ data = JSON . parse ( data ) ;
23632365 //console.log(data);
23642366 updateLastInfo ( data ) ;
23652367} ) ;
@@ -2371,6 +2373,8 @@ var otk = null;
23712373var owner = null ;
23722374var permission = null ;
23732375socket . on ( 'refresh' , function ( data ) {
2376+ data = LZString . decompressFromUTF16 ( data ) ;
2377+ data = JSON . parse ( data ) ;
23742378 //console.log(data);
23752379 docmaxlength = data . docmaxlength ;
23762380 editor . setOption ( "maxLength" , docmaxlength ) ;
You can’t perform that action at this time.
0 commit comments