diff options
-rw-r--r-- | discovery.xml | 6 | ||||
-rw-r--r-- | wsd/LOOLWSD.cpp | 16 |
2 files changed, 18 insertions, 4 deletions
diff --git a/discovery.xml b/discovery.xml index 22b284621b..7612b23a98 100644 --- a/discovery.xml +++ b/discovery.xml @@ -3,7 +3,7 @@ <net-zone name="external-http"> <!-- Writer documents --> - <app name="writer"> + <app name="writer" favIconUrl="images/x-office-document.svg"> <action name="view" default="true" ext="sxw"/> <action name="edit" default="true" ext="odt"/> <action name="edit" default="true" ext="fodt"/> @@ -48,7 +48,7 @@ </app> <!-- Calc documents --> - <app name="calc"> + <app name="calc" favIconUrl="images/x-office-spreadsheet.svg"> <action name="view" default="true" ext="sxc"/> <action name="edit" default="true" ext="ods"/> <action name="edit" default="true" ext="fods"/> @@ -75,7 +75,7 @@ </app> <!-- Impress documents --> - <app name="impress"> + <app name="impress" favIconUrl="images/x-office-presentation.svg"> <action name="view" default="true" ext="sxi"/> <action name="edit" default="true" ext="odp"/> <action name="edit" default="true" ext="fodp"/> diff --git a/wsd/LOOLWSD.cpp b/wsd/LOOLWSD.cpp index 9d89727aee..a845932fa7 100644 --- a/wsd/LOOLWSD.cpp +++ b/wsd/LOOLWSD.cpp @@ -3471,10 +3471,12 @@ private: const std::string loleafletHtml = config.getString("loleaflet_html", "loleaflet.html"); const std::string action = "action"; + const std::string favIconUrl = "favIconUrl"; const std::string urlsrc = "urlsrc"; const std::string rootUriValue = "%SRV_URI%"; - const std::string uriValue = rootUriValue + "/loleaflet/" LOOLWSD_VERSION_HASH "/" + loleafletHtml + '?'; + const std::string uriBaseValue = rootUriValue + "/loleaflet/" LOOLWSD_VERSION_HASH "/"; + const std::string uriValue = uriBaseValue + loleafletHtml + '?'; InputSource inputSrc(discoveryPath); DOMParser parser; @@ -3503,6 +3505,18 @@ private: } } + // turn "images/img.svg" into "http://server.tld/loleaflet/12345abcd/images/img.svg" + listNodes = docXML->getElementsByTagName("app"); + for (unsigned long it = 0; it < listNodes->length(); ++it) + { + Element* elem = static_cast<Element*>(listNodes->item(it)); + + if (elem->hasAttribute(favIconUrl)) + { + elem->setAttribute(favIconUrl, uriBaseValue + elem->getAttribute(favIconUrl)); + } + } + const auto& proofAttribs = GetProofKeyAttributes(); if (!proofAttribs.empty()) { |