Loading patches/036-user-config-change-event.patch +17 −22 Original line number Diff line number Diff line --- ./lib/private/AllConfig.php 2024-03-28 01:02:39 +++ ./lib/private/AllConfig-new.php 2024-04-15 16:36:23 @@ -14,7 +14,10 @@ --- ./lib/private/AllConfig.php 2026-03-23 17:46:39.507001638 +0600 +++ ./lib/private/AllConfig-new.php 2026-03-24 10:06:42.964988528 +0600 @@ -15,6 +15,8 @@ use OCP\IConfig; use OCP\IDBConnection; use OCP\PreConditionNotMetException; +use OCP\EventDispatcher\IEventDispatcher; +use OCP\User\Events\UserConfigChangedEvent; + /** * Class to combine all the configuration options ownCloud offers */ @@ -252,9 +255,18 @@ } catch (TypeConflictException) { @@ -254,7 +256,16 @@ } } - + $prevValue = $this->getUserValue($userId, $appName, $key, null); $userPreferences->setValueMixed($userId, $appName, $key, (string)$value); + $this->triggerUserValueChange($userId, $appName, $key, $value, $prevValue); } + } + + private function triggerUserValueChange($userId, $appId, $key, $value, $oldValue = null) { + if (\OC::$server instanceof \OCP\IServerContainer) { + $dispatcher = \OC::$server->get(IEventDispatcher::class); + $dispatcher->dispatchTyped(new UserConfigChangedEvent($userId, $appId, $key, $value, $oldValue)); + } + } + } /** * Getting a user defined value --- ./lib/composer/composer/autoload_static.php 2024-03-28 01:02:39 +++ ./lib/composer/composer/autoload_static-new.php 2024-04-15 16:34:18 @@ -982,6 +982,7 @@ --- ./lib/composer/composer/autoload_static.php 2026-03-23 17:46:39.466001738 +0600 +++ ./lib/composer/composer/autoload_static-new.php 2026-03-24 10:08:47.549748084 +0600 @@ -1024,6 +1024,7 @@ 'OCP\\User\\Events\\PasswordUpdatedEvent' => __DIR__ . '/../../..' . '/lib/public/User/Events/PasswordUpdatedEvent.php', 'OCP\\User\\Events\\PostLoginEvent' => __DIR__ . '/../../..' . '/lib/public/User/Events/PostLoginEvent.php', 'OCP\\User\\Events\\UserChangedEvent' => __DIR__ . '/../../..' . '/lib/public/User/Events/UserChangedEvent.php', Loading @@ -43,9 +38,9 @@ 'OCP\\User\\Events\\UserDeletedEvent' => __DIR__ . '/../../..' . '/lib/public/User/Events/UserDeletedEvent.php', 'OCP\\User\\Events\\UserFirstTimeLoggedInEvent' => __DIR__ . '/../../..' . '/lib/public/User/Events/UserFirstTimeLoggedInEvent.php', --- ./lib/composer/composer/autoload_classmap.php 2024-03-28 01:02:39 +++ ./lib/composer/composer/autoload_classmap-new.php 2024-04-15 16:33:19 @@ -942,6 +942,7 @@ --- ./lib/composer/composer/autoload_classmap.php 2026-03-23 17:46:39.465001741 +0600 +++ ./lib/composer/composer/autoload_classmap-new.php 2026-03-24 10:12:24.817105217 +0600 @@ -992,6 +992,7 @@ 'OCP\\User\\Events\\UserLoggedInEvent' => $baseDir . '/lib/public/User/Events/UserLoggedInEvent.php', 'OCP\\User\\Events\\UserLoggedInWithCookieEvent' => $baseDir . '/lib/public/User/Events/UserLoggedInWithCookieEvent.php', 'OCP\\User\\Events\\UserLoggedOutEvent' => $baseDir . '/lib/public/User/Events/UserLoggedOutEvent.php', Loading @@ -54,8 +49,8 @@ 'OCP\\User\\IAvailabilityCoordinator' => $baseDir . '/lib/public/User/IAvailabilityCoordinator.php', 'OCP\\User\\IOutOfOfficeData' => $baseDir . '/lib/public/User/IOutOfOfficeData.php', --- /dev/null 2024-04-16 13:44:50 +++ ./lib/public/User/Events/UserConfigChangedEvent.php 2024-04-16 13:43:17 --- /dev/null 2026-03-23 17:47:39.465001741 +0600 +++ ./lib/public/User/Events/UserConfigChangedEvent.php 2026-03-24 10:13:24.817105217 +0600 @@ -0,0 +1,69 @@ +<?php + Loading Loading
patches/036-user-config-change-event.patch +17 −22 Original line number Diff line number Diff line --- ./lib/private/AllConfig.php 2024-03-28 01:02:39 +++ ./lib/private/AllConfig-new.php 2024-04-15 16:36:23 @@ -14,7 +14,10 @@ --- ./lib/private/AllConfig.php 2026-03-23 17:46:39.507001638 +0600 +++ ./lib/private/AllConfig-new.php 2026-03-24 10:06:42.964988528 +0600 @@ -15,6 +15,8 @@ use OCP\IConfig; use OCP\IDBConnection; use OCP\PreConditionNotMetException; +use OCP\EventDispatcher\IEventDispatcher; +use OCP\User\Events\UserConfigChangedEvent; + /** * Class to combine all the configuration options ownCloud offers */ @@ -252,9 +255,18 @@ } catch (TypeConflictException) { @@ -254,7 +256,16 @@ } } - + $prevValue = $this->getUserValue($userId, $appName, $key, null); $userPreferences->setValueMixed($userId, $appName, $key, (string)$value); + $this->triggerUserValueChange($userId, $appName, $key, $value, $prevValue); } + } + + private function triggerUserValueChange($userId, $appId, $key, $value, $oldValue = null) { + if (\OC::$server instanceof \OCP\IServerContainer) { + $dispatcher = \OC::$server->get(IEventDispatcher::class); + $dispatcher->dispatchTyped(new UserConfigChangedEvent($userId, $appId, $key, $value, $oldValue)); + } + } + } /** * Getting a user defined value --- ./lib/composer/composer/autoload_static.php 2024-03-28 01:02:39 +++ ./lib/composer/composer/autoload_static-new.php 2024-04-15 16:34:18 @@ -982,6 +982,7 @@ --- ./lib/composer/composer/autoload_static.php 2026-03-23 17:46:39.466001738 +0600 +++ ./lib/composer/composer/autoload_static-new.php 2026-03-24 10:08:47.549748084 +0600 @@ -1024,6 +1024,7 @@ 'OCP\\User\\Events\\PasswordUpdatedEvent' => __DIR__ . '/../../..' . '/lib/public/User/Events/PasswordUpdatedEvent.php', 'OCP\\User\\Events\\PostLoginEvent' => __DIR__ . '/../../..' . '/lib/public/User/Events/PostLoginEvent.php', 'OCP\\User\\Events\\UserChangedEvent' => __DIR__ . '/../../..' . '/lib/public/User/Events/UserChangedEvent.php', Loading @@ -43,9 +38,9 @@ 'OCP\\User\\Events\\UserDeletedEvent' => __DIR__ . '/../../..' . '/lib/public/User/Events/UserDeletedEvent.php', 'OCP\\User\\Events\\UserFirstTimeLoggedInEvent' => __DIR__ . '/../../..' . '/lib/public/User/Events/UserFirstTimeLoggedInEvent.php', --- ./lib/composer/composer/autoload_classmap.php 2024-03-28 01:02:39 +++ ./lib/composer/composer/autoload_classmap-new.php 2024-04-15 16:33:19 @@ -942,6 +942,7 @@ --- ./lib/composer/composer/autoload_classmap.php 2026-03-23 17:46:39.465001741 +0600 +++ ./lib/composer/composer/autoload_classmap-new.php 2026-03-24 10:12:24.817105217 +0600 @@ -992,6 +992,7 @@ 'OCP\\User\\Events\\UserLoggedInEvent' => $baseDir . '/lib/public/User/Events/UserLoggedInEvent.php', 'OCP\\User\\Events\\UserLoggedInWithCookieEvent' => $baseDir . '/lib/public/User/Events/UserLoggedInWithCookieEvent.php', 'OCP\\User\\Events\\UserLoggedOutEvent' => $baseDir . '/lib/public/User/Events/UserLoggedOutEvent.php', Loading @@ -54,8 +49,8 @@ 'OCP\\User\\IAvailabilityCoordinator' => $baseDir . '/lib/public/User/IAvailabilityCoordinator.php', 'OCP\\User\\IOutOfOfficeData' => $baseDir . '/lib/public/User/IOutOfOfficeData.php', --- /dev/null 2024-04-16 13:44:50 +++ ./lib/public/User/Events/UserConfigChangedEvent.php 2024-04-16 13:43:17 --- /dev/null 2026-03-23 17:47:39.465001741 +0600 +++ ./lib/public/User/Events/UserConfigChangedEvent.php 2026-03-24 10:13:24.817105217 +0600 @@ -0,0 +1,69 @@ +<?php + Loading