]> source.dussan.org Git - nextcloud-server.git/commitdiff
generate user themed favicon and touchicon 38823/head
authorSimon L <szaimen@e.mail.de>
Wed, 14 Jun 2023 17:58:31 +0000 (19:58 +0200)
committerSimon L <szaimen@e.mail.de>
Thu, 15 Jun 2023 22:24:27 +0000 (00:24 +0200)
Signed-off-by: Simon L <szaimen@e.mail.de>
apps/theming/lib/Controller/IconController.php

index 08ee71ac660c5955bc8ebabdacc79e8ad9db7ae2..1b16293a7f34c7e57a189df3795fe51932b98e9f 100644 (file)
@@ -120,14 +120,15 @@ class IconController extends Controller {
                } catch (NotFoundException $e) {
                }
                if ($iconFile === null && $this->imageManager->shouldReplaceIcons()) {
+                       $color = $this->themingDefaults->getColorPrimary();
                        try {
-                               $iconFile = $this->imageManager->getCachedImage('favIcon-' . $app);
+                               $iconFile = $this->imageManager->getCachedImage('favIcon-' . $app . $color);
                        } catch (NotFoundException $exception) {
                                $icon = $this->iconBuilder->getFavicon($app);
                                if ($icon === false || $icon === '') {
                                        return new NotFoundResponse();
                                }
-                               $iconFile = $this->imageManager->setCachedImage('favIcon-' . $app, $icon);
+                               $iconFile = $this->imageManager->setCachedImage('favIcon-' . $app . $color, $icon);
                        }
                        $response = new FileDisplayResponse($iconFile, Http::STATUS_OK, ['Content-Type' => 'image/x-icon']);
                }
@@ -157,14 +158,15 @@ class IconController extends Controller {
                } catch (NotFoundException $e) {
                }
                if ($this->imageManager->shouldReplaceIcons()) {
+                       $color = $this->themingDefaults->getColorPrimary();
                        try {
-                               $iconFile = $this->imageManager->getCachedImage('touchIcon-' . $app);
+                               $iconFile = $this->imageManager->getCachedImage('touchIcon-' . $app . $color);
                        } catch (NotFoundException $exception) {
                                $icon = $this->iconBuilder->getTouchIcon($app);
                                if ($icon === false || $icon === '') {
                                        return new NotFoundResponse();
                                }
-                               $iconFile = $this->imageManager->setCachedImage('touchIcon-' . $app, $icon);
+                               $iconFile = $this->imageManager->setCachedImage('touchIcon-' . $app . $color, $icon);
                        }
                        $response = new FileDisplayResponse($iconFile, Http::STATUS_OK, ['Content-Type' => 'image/png']);
                }