[Libreoffice-commits] online.git: loleaflet/src wsd/ClientSession.cpp wsd/protocol.txt

Ashod Nakashian (via logerrit) logerrit at kemper.freedesktop.org
Sat Aug 17 02:32:28 UTC 2019


 loleaflet/src/layer/tile/TileLayer.js |    2 +-
 wsd/ClientSession.cpp                 |    4 +++-
 wsd/protocol.txt                      |    7 ++++++-
 3 files changed, 10 insertions(+), 3 deletions(-)

New commits:
commit 8e118889cbabc279d7cf6746576330816f0e562c
Author:     Ashod Nakashian <ashod.nakashian at collabora.co.uk>
AuthorDate: Mon Sep 17 06:45:57 2018 -0400
Commit:     Ashod Nakashian <ashnakash at gmail.com>
CommitDate: Sat Aug 17 04:32:09 2019 +0200

    wsd: leaflet: support statusupdate: messages to sync clients
    
    This new message is identical to status: except it doesn't
    imply (re)connection. It's unfortunate that status: is
    assumed to be sent only when establishing connection and
    loading a document, so we need a different notification
    that can be sent at any time, without triggering
    initalization logic on the client-side.
    
    Change-Id: I9c804119aec292b873aeed132cc32f13c030d845
    Reviewed-on: https://gerrit.libreoffice.org/69634
    Reviewed-by: Ashod Nakashian <ashnakash at gmail.com>
    Tested-by: Ashod Nakashian <ashnakash at gmail.com>
    Reviewed-on: https://gerrit.libreoffice.org/71098

diff --git a/loleaflet/src/layer/tile/TileLayer.js b/loleaflet/src/layer/tile/TileLayer.js
index 87cf380f4..63a47d4bc 100644
--- a/loleaflet/src/layer/tile/TileLayer.js
+++ b/loleaflet/src/layer/tile/TileLayer.js
@@ -452,7 +452,7 @@ L.TileLayer = L.GridLayer.extend({
 		else if (textMsg.startsWith('statechanged:')) {
 			this._onStateChangedMsg(textMsg);
 		}
-		else if (textMsg.startsWith('status:')) {
+		else if (textMsg.startsWith('status:') || textMsg.startsWith('statusupdate:')) {
 			this._onStatusMsg(textMsg);
 		}
 		else if (textMsg.startsWith('textselection:')) {
diff --git a/wsd/ClientSession.cpp b/wsd/ClientSession.cpp
index e12f57a46..f10f08724 100644
--- a/wsd/ClientSession.cpp
+++ b/wsd/ClientSession.cpp
@@ -404,6 +404,7 @@ bool ClientSession::_handleInput(const char *buffer, int length)
              tokens[0] != "selectclientpart" &&
              tokens[0] != "setpage" &&
              tokens[0] != "status" &&
+             tokens[0] != "statusupdate" &&
              tokens[0] != "tile" &&
              tokens[0] != "tilecombine" &&
              tokens[0] != "uno" &&
@@ -419,6 +420,7 @@ bool ClientSession::_handleInput(const char *buffer, int length)
              tokens[0] != "removesession" &&
              tokens[0] != "renamefile")
     {
+        LOG_ERR("Session [" << getId() << "] got unknown command [" << tokens[0] << "].");
         sendTextFrame("error: cmd=" + tokens[0] + " kind=unknown");
         return false;
     }
@@ -481,7 +483,7 @@ bool ClientSession::_handleInput(const char *buffer, int length)
     {
         return sendFontRendering(buffer, length, tokens, docBroker);
     }
-    else if (tokens[0] == "status")
+    else if (tokens[0] == "status" || tokens[0] == "statusupdate")
     {
         assert(firstLine.size() == static_cast<size_t>(length));
         return forwardToChild(firstLine, docBroker);
diff --git a/wsd/protocol.txt b/wsd/protocol.txt
index 0df5bdb9c..a1bdb39cb 100644
--- a/wsd/protocol.txt
+++ b/wsd/protocol.txt
@@ -373,11 +373,16 @@ saveas: url=<url> name=<name>
     <name> is the resulting name (without path) that was created on the wopi
     host. It can differ from what was requested in case the file already existed.
 
-status: type=<typeName> parts=<numberOfParts> current=<currentPartNumber> width=<width> height=<height> viewid=<viewId> [partNames]
+status: type=<typeName> parts=<numberOfParts> current=<currentPartNumber> width=<width> height=<height> viewid=<viewId> hiddenparts=<part1,part2,...> selectedparts=<part1,part2,...> [partNames]
 
     <typeName> is 'text, 'spreadsheet', 'presentation', 'drawing' or 'other. Others are numbers.
     if the document has multiple parts and those have names, part names follow separated by '\n'
 
+statusupdate: type=<typeName> parts=<numberOfParts> current=<currentPartNumber> width=<width> height=<height> viewid=<viewId> hiddenparts=<part1,part2,...> selectedparts=<part1,part2,...> [partNames]
+
+    Same as status: but issued whenever the document parts have updated significantly.
+    status: implies document loading. statusupdate: is just an update.
+
 styles: {"styleFamily": ["styles in family"], etc. }
 
 statechanged: <key>=<value>


More information about the Libreoffice-commits mailing list