[Libreoffice-commits] online.git: Branch 'distro/collabora/co-4-2' - loleaflet/src wsd/DocumentBroker.cpp

Mike Kaganski (via logerrit) logerrit at kemper.freedesktop.org
Fri Jun 26 19:17:07 UTC 2020


 loleaflet/src/map/Map.js |    5 +++++
 wsd/DocumentBroker.cpp   |    4 ++++
 2 files changed, 9 insertions(+)

New commits:
commit 3383b13085178342adfe6781e30d88c3ad5cb248
Author:     Mike Kaganski <mike.kaganski at collabora.com>
AuthorDate: Fri Jun 26 14:47:37 2020 +0300
Commit:     Andras Timar <andras.timar at collabora.com>
CommitDate: Fri Jun 26 21:16:45 2020 +0200

    Don't show last modification indicator when data is unavailable
    
    E.g., SharePoint 2013 and 2016 don't support LastModifiedTime field
    in CheckFileInfo [1].
    
    [1] https://docs.microsoft.com/en-us/openspecs/office_protocols/ms-wopi/e2e91eab-4c6d-4f00-9c3f-3a1962135626#Appendix_A_30
    
    Change-Id: Icdcf9f82758b4bd34be25f553e9d756ab76b8bfa
    Reviewed-on: https://gerrit.libreoffice.org/c/online/+/97221
    Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice at gmail.com>
    Reviewed-by: Andras Timar <andras.timar at collabora.com>
    (cherry picked from commit ec1bc5807090dea9f28ef25c6211785c7fa1a00f)
    Reviewed-on: https://gerrit.libreoffice.org/c/online/+/97144

diff --git a/loleaflet/src/map/Map.js b/loleaflet/src/map/Map.js
index 67bac9bfd..5f9882a53 100644
--- a/loleaflet/src/map/Map.js
+++ b/loleaflet/src/map/Map.js
@@ -386,6 +386,11 @@ L.Map = L.Evented.extend({
 		if (lastModButton !== null && lastModButton !== undefined
 			&& lastModButton.firstChild.innerHTML !== null
 			&& lastModButton.firstChild.childElementCount == 0) {
+			if (this._lastmodtime == null) {
+				// No modification time -> hide the indicator
+				lastModButton.innerHTML = '';
+				return;
+			}
 			var mainSpan = document.createElement('span');
 			var label = document.createTextNode(_('Last modification'));
 			var separator = document.createTextNode(': ');
diff --git a/wsd/DocumentBroker.cpp b/wsd/DocumentBroker.cpp
index 55e921295..5e647ec76 100644
--- a/wsd/DocumentBroker.cpp
+++ b/wsd/DocumentBroker.cpp
@@ -74,6 +74,10 @@ void sendLastModificationTime(const std::shared_ptr<Session>& session,
     if (!session)
         return;
 
+    if (documentLastModifiedTime == std::chrono::system_clock::time_point())
+        // No time from the storage (e.g., SharePoint 2013 and 2016) -> don't send
+        return;
+
     std::stringstream stream;
     stream << "lastmodtime: " << documentLastModifiedTime;
     const std::string message = stream.str();


More information about the Libreoffice-commits mailing list