[Libreoffice-commits] online.git: 2 commits - loleaflet/src loolwsd/DocumentBroker.cpp loolwsd/MasterProcessSession.cpp loolwsd/protocol.txt
Pranav Kant
pranavk at collabora.com
Fri Apr 8 20:23:40 UTC 2016
loleaflet/src/layer/tile/TileLayer.js | 2 +-
loolwsd/DocumentBroker.cpp | 4 ++--
loolwsd/MasterProcessSession.cpp | 4 ++--
loolwsd/protocol.txt | 11 +++++++++++
4 files changed, 16 insertions(+), 5 deletions(-)
New commits:
commit 9444bb2b8765d387e04e45af143572a9de4aa02b
Author: Pranav Kant <pranavk at collabora.com>
Date: Sat Apr 9 01:52:17 2016 +0530
loolwsd: update documentation about editlock
Change-Id: Id819a2e2d0739a773c5a01ec7bc80152c03bf8f0
diff --git a/loolwsd/protocol.txt b/loolwsd/protocol.txt
index e5950dc..c2c0acb 100644
--- a/loolwsd/protocol.txt
+++ b/loolwsd/protocol.txt
@@ -176,6 +176,17 @@ downloadas: jail=<jail directory> dir=<a tmp dir> name=<name> port=<port>
The client should then request http://server:port/jail/dir/name in order to download
the document
+editlock: <1 or 0>
+
+ Informs the client of any change in ownership of edit lock. A value of '1'
+ means client can edit the document, and '0' means that client can only view
+ the document. This message always follows the 'status:' message after a
+ document is loaded, so that client has this information as soon as it loads
+ the document.
+
+ Note that only one client can have the editlock at a time and
+ others can only view.
+
error: cmd=<command> kind=<kind> [code=<error_code>]
<freeErrorText>
commit 9469021f74d8b1896dce33e81daf3381207b1687
Author: Pranav Kant <pranavk at collabora.com>
Date: Sat Apr 9 01:46:03 2016 +0530
consistency, server -> client messages ends with a colon
Change-Id: Ia2154603bf0b9432beeaae970f68daa1ea7f7ebd
diff --git a/loleaflet/src/layer/tile/TileLayer.js b/loleaflet/src/layer/tile/TileLayer.js
index afd26f4..356f7b7 100644
--- a/loleaflet/src/layer/tile/TileLayer.js
+++ b/loleaflet/src/layer/tile/TileLayer.js
@@ -331,7 +331,7 @@ L.TileLayer = L.GridLayer.extend({
else if (textMsg.startsWith('unocommandresult:')) {
this._onUnoCommandResultMsg(textMsg);
}
- else if (textMsg.startsWith('editlock')) {
+ else if (textMsg.startsWith('editlock:')) {
this._onEditLock(textMsg);
}
else if (textMsg.startsWith('contextmenu:')) {
diff --git a/loolwsd/DocumentBroker.cpp b/loolwsd/DocumentBroker.cpp
index b8cfa61..aee583d 100644
--- a/loolwsd/DocumentBroker.cpp
+++ b/loolwsd/DocumentBroker.cpp
@@ -156,12 +156,12 @@ void DocumentBroker::takeEditLock(const std::string id)
if (it.first != id)
{
it.second->setEditLock(false);
- it.second->sendTextFrame("editlock 0");
+ it.second->sendTextFrame("editlock: 0");
}
else
{
it.second->setEditLock(true);
- it.second->sendTextFrame("editlock 1");
+ it.second->sendTextFrame("editlock: 1");
}
}
}
diff --git a/loolwsd/MasterProcessSession.cpp b/loolwsd/MasterProcessSession.cpp
index 5e5047f..b7cab54 100644
--- a/loolwsd/MasterProcessSession.cpp
+++ b/loolwsd/MasterProcessSession.cpp
@@ -232,7 +232,7 @@ bool MasterProcessSession::_handleInput(const char *buffer, int length)
_docBroker->tileCache().saveTextFile(std::string(buffer, length), "status.txt");
// let clients know if they hold the edit lock
- std::string message = "editlock ";
+ std::string message = "editlock: ";
message += std::to_string(peer->isEditLocked());
forwardToPeer(message.c_str(), message.size());
}
@@ -474,7 +474,7 @@ bool MasterProcessSession::getStatus(const char *buffer, int length)
{
sendTextFrame(status);
// let clients know if they hold the edit lock
- std::string message = "editlock ";
+ std::string message = "editlock: ";
message += std::to_string(isEditLocked());
sendTextFrame(message);
return true;
More information about the Libreoffice-commits
mailing list