[Libreoffice-commits] online.git: Branch 'distro/collabora/collabora-online-4' - loleaflet/src wsd/ClientSession.cpp wsd/protocol.txt
Libreoffice Gerrit user
logerrit at kemper.freedesktop.org
Mon Apr 15 02:24:07 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 6dce712ff4680fb7add00ebf6e4b78f61dda3e79
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: Mon Apr 15 04:23:45 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>
diff --git a/loleaflet/src/layer/tile/TileLayer.js b/loleaflet/src/layer/tile/TileLayer.js
index 42c880e57..ca302390e 100644
--- a/loleaflet/src/layer/tile/TileLayer.js
+++ b/loleaflet/src/layer/tile/TileLayer.js
@@ -432,7 +432,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 f9b8739f5..c2fbee956 100644
--- a/wsd/ClientSession.cpp
+++ b/wsd/ClientSession.cpp
@@ -167,6 +167,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" &&
@@ -181,6 +182,7 @@ bool ClientSession::_handleInput(const char *buffer, int length)
tokens[0] != "rendershapeselection" &&
tokens[0] != "removesession")
{
+ LOG_ERR("Session [" << getId() << "] got unknown command [" << tokens[0] << "].");
sendTextFrame("error: cmd=" + tokens[0] + " kind=unknown");
return false;
}
@@ -241,7 +243,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 a4631c912..cb5554e4c 100644
--- a/wsd/protocol.txt
+++ b/wsd/protocol.txt
@@ -369,11 +369,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