From 14c33bb2e9fc32594fdbcffa1edde1f1e15665cc Mon Sep 17 00:00:00 2001 From: Mikael Saarinen Date: Sat, 12 Jun 2021 11:15:51 +0300 Subject: Add regex to match Windows 10 calendar user-agent * Match first part of the Windows 10 calendar user-agent * Exposes subscribed calendars for Windows 10 calendar * Update unit test Signed-off-by: Mikael Saarinen --- apps/dav/lib/CalDAV/WebcalCaching/Plugin.php | 5 ++++- apps/dav/tests/unit/CalDAV/WebcalCaching/PluginTest.php | 4 ++-- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/apps/dav/lib/CalDAV/WebcalCaching/Plugin.php b/apps/dav/lib/CalDAV/WebcalCaching/Plugin.php index 13aef7ed227..3dd8a7c81e5 100644 --- a/apps/dav/lib/CalDAV/WebcalCaching/Plugin.php +++ b/apps/dav/lib/CalDAV/WebcalCaching/Plugin.php @@ -40,9 +40,12 @@ class Plugin extends ServerPlugin { * list of regular expressions for calendar user agents, * that do not support subscriptions on their own * + * /^MSFT-WIN-3/ - Windows 10 Calendar * @var string[] */ - public const ENABLE_FOR_CLIENTS = []; + public const ENABLE_FOR_CLIENTS = [ + "/^MSFT-WIN-3/" + ]; /** * @var bool diff --git a/apps/dav/tests/unit/CalDAV/WebcalCaching/PluginTest.php b/apps/dav/tests/unit/CalDAV/WebcalCaching/PluginTest.php index b848a5d591a..310d266cd57 100644 --- a/apps/dav/tests/unit/CalDAV/WebcalCaching/PluginTest.php +++ b/apps/dav/tests/unit/CalDAV/WebcalCaching/PluginTest.php @@ -31,7 +31,7 @@ class PluginTest extends \Test\TestCase { $request = $this->createMock(IRequest::class); $request->expects($this->at(0)) ->method('isUserAgent') - ->with([]) + ->with(Plugin::ENABLE_FOR_CLIENTS) ->willReturn(false); $request->expects($this->at(1)) @@ -48,7 +48,7 @@ class PluginTest extends \Test\TestCase { $request = $this->createMock(IRequest::class); $request->expects($this->at(0)) ->method('isUserAgent') - ->with([]) + ->with(Plugin::ENABLE_FOR_CLIENTS) ->willReturn(false); $request->expects($this->at(1)) -- cgit v1.2.3