diff options
author | Mike Kaganski <mike.kaganski@collabora.com> | 2020-06-26 14:47:37 +0300 |
---|---|---|
committer | Andras Timar <andras.timar@collabora.com> | 2020-06-26 21:17:50 +0200 |
commit | d8422e17e1d30962229de76224cb7fcd13a881b4 (patch) | |
tree | 2609edb539d2c741dfe4470280be055ba32e6883 | |
parent | existing integrations prefer text/rtf (diff) | |
download | online-d8422e17e1d30962229de76224cb7fcd13a881b4.tar.gz online-d8422e17e1d30962229de76224cb7fcd13a881b4.zip |
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@gmail.com>
Reviewed-by: Andras Timar <andras.timar@collabora.com>
(cherry picked from commit ec1bc5807090dea9f28ef25c6211785c7fa1a00f)
Reviewed-on: https://gerrit.libreoffice.org/c/online/+/97144
-rw-r--r-- | loleaflet/src/map/Map.js | 5 | ||||
-rw-r--r-- | wsd/DocumentBroker.cpp | 4 |
2 files changed, 9 insertions, 0 deletions
diff --git a/loleaflet/src/map/Map.js b/loleaflet/src/map/Map.js index 67bac9bfdc..5f9882a53d 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 55e9212954..5e647ec765 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(); |