diff options
author | Andrey Borysenko <andrey18106x@gmail.com> | 2023-08-10 17:21:35 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-08-10 17:21:35 +0300 |
commit | f7b2dc8cccb6671f2119e92c00eb182608062136 (patch) | |
tree | 7785b26d0b26c84938722c63de794eb59d0103d5 /lib | |
parent | d3583d3f309dc68c984d22ff4edd8e436776b475 (diff) | |
parent | 5408dbfd62f3d43f5bf474b67825f1e904aeb25d (diff) | |
download | nextcloud-server-f7b2dc8cccb6671f2119e92c00eb182608062136.tar.gz nextcloud-server-f7b2dc8cccb6671f2119e92c00eb182608062136.zip |
Merge branch 'master' into appecosystem-auth
Diffstat (limited to 'lib')
71 files changed, 908 insertions, 567 deletions
diff --git a/lib/base.php b/lib/base.php index e201ca29dcf..b328165fdfa 100644 --- a/lib/base.php +++ b/lib/base.php @@ -67,7 +67,6 @@ declare(strict_types=1); */ use OC\Encryption\HookManager; -use OC\EventDispatcher\SymfonyAdapter; use OC\Share20\Hooks; use OCP\EventDispatcher\IEventDispatcher; use OCP\Group\Events\UserRemovedEvent; @@ -939,7 +938,7 @@ class OC { } private static function registerResourceCollectionHooks(): void { - \OC\Collaboration\Resources\Listener::register(Server::get(SymfonyAdapter::class), Server::get(IEventDispatcher::class)); + \OC\Collaboration\Resources\Listener::register(Server::get(IEventDispatcher::class)); } private static function registerFileReferenceEventListener(): void { diff --git a/lib/composer/composer/autoload_classmap.php b/lib/composer/composer/autoload_classmap.php index 818d1865311..2e5c239b6ed 100644 --- a/lib/composer/composer/autoload_classmap.php +++ b/lib/composer/composer/autoload_classmap.php @@ -12,6 +12,7 @@ return array( 'OCP\\Accounts\\IAccountProperty' => $baseDir . '/lib/public/Accounts/IAccountProperty.php', 'OCP\\Accounts\\IAccountPropertyCollection' => $baseDir . '/lib/public/Accounts/IAccountPropertyCollection.php', 'OCP\\Accounts\\PropertyDoesNotExistException' => $baseDir . '/lib/public/Accounts/PropertyDoesNotExistException.php', + 'OCP\\Accounts\\UserUpdatedEvent' => $baseDir . '/lib/public/Accounts/UserUpdatedEvent.php', 'OCP\\Activity\\ActivitySettings' => $baseDir . '/lib/public/Activity/ActivitySettings.php', 'OCP\\Activity\\IConsumer' => $baseDir . '/lib/public/Activity/IConsumer.php', 'OCP\\Activity\\IEvent' => $baseDir . '/lib/public/Activity/IEvent.php', @@ -309,7 +310,9 @@ return array( 'OCP\\Files\\Events\\FolderScannedEvent' => $baseDir . '/lib/public/Files/Events/FolderScannedEvent.php', 'OCP\\Files\\Events\\InvalidateMountCacheEvent' => $baseDir . '/lib/public/Files/Events/InvalidateMountCacheEvent.php', 'OCP\\Files\\Events\\NodeAddedToCache' => $baseDir . '/lib/public/Files/Events/NodeAddedToCache.php', + 'OCP\\Files\\Events\\NodeAddedToFavorite' => $baseDir . '/lib/public/Files/Events/NodeAddedToFavorite.php', 'OCP\\Files\\Events\\NodeRemovedFromCache' => $baseDir . '/lib/public/Files/Events/NodeRemovedFromCache.php', + 'OCP\\Files\\Events\\NodeRemovedFromFavorite' => $baseDir . '/lib/public/Files/Events/NodeRemovedFromFavorite.php', 'OCP\\Files\\Events\\Node\\AbstractNodeEvent' => $baseDir . '/lib/public/Files/Events/Node/AbstractNodeEvent.php', 'OCP\\Files\\Events\\Node\\AbstractNodesEvent' => $baseDir . '/lib/public/Files/Events/Node/AbstractNodesEvent.php', 'OCP\\Files\\Events\\Node\\BeforeNodeCopiedEvent' => $baseDir . '/lib/public/Files/Events/Node/BeforeNodeCopiedEvent.php', @@ -583,8 +586,12 @@ return array( 'OCP\\Settings\\ISettings' => $baseDir . '/lib/public/Settings/ISettings.php', 'OCP\\Settings\\ISubAdminSettings' => $baseDir . '/lib/public/Settings/ISubAdminSettings.php', 'OCP\\Share' => $baseDir . '/lib/public/Share.php', + 'OCP\\Share\\Events\\BeforeShareCreatedEvent' => $baseDir . '/lib/public/Share/Events/BeforeShareCreatedEvent.php', + 'OCP\\Share\\Events\\BeforeShareDeletedEvent' => $baseDir . '/lib/public/Share/Events/BeforeShareDeletedEvent.php', + 'OCP\\Share\\Events\\ShareAcceptedEvent' => $baseDir . '/lib/public/Share/Events/ShareAcceptedEvent.php', 'OCP\\Share\\Events\\ShareCreatedEvent' => $baseDir . '/lib/public/Share/Events/ShareCreatedEvent.php', 'OCP\\Share\\Events\\ShareDeletedEvent' => $baseDir . '/lib/public/Share/Events/ShareDeletedEvent.php', + 'OCP\\Share\\Events\\ShareDeletedFromSelfEvent' => $baseDir . '/lib/public/Share/Events/ShareDeletedFromSelfEvent.php', 'OCP\\Share\\Events\\VerifyMountPointEvent' => $baseDir . '/lib/public/Share/Events/VerifyMountPointEvent.php', 'OCP\\Share\\Exceptions\\AlreadySharedException' => $baseDir . '/lib/public/Share/Exceptions/AlreadySharedException.php', 'OCP\\Share\\Exceptions\\GenericShareException' => $baseDir . '/lib/public/Share/Exceptions/GenericShareException.php', @@ -682,6 +689,7 @@ return array( 'OCP\\User\\Events\\UserChangedEvent' => $baseDir . '/lib/public/User/Events/UserChangedEvent.php', 'OCP\\User\\Events\\UserCreatedEvent' => $baseDir . '/lib/public/User/Events/UserCreatedEvent.php', 'OCP\\User\\Events\\UserDeletedEvent' => $baseDir . '/lib/public/User/Events/UserDeletedEvent.php', + 'OCP\\User\\Events\\UserFirstTimeLoggedInEvent' => $baseDir . '/lib/public/User/Events/UserFirstTimeLoggedInEvent.php', 'OCP\\User\\Events\\UserLiveStatusEvent' => $baseDir . '/lib/public/User/Events/UserLiveStatusEvent.php', 'OCP\\User\\Events\\UserLoggedInEvent' => $baseDir . '/lib/public/User/Events/UserLoggedInEvent.php', 'OCP\\User\\Events\\UserLoggedInWithCookieEvent' => $baseDir . '/lib/public/User/Events/UserLoggedInWithCookieEvent.php', @@ -1144,6 +1152,8 @@ return array( 'OC\\Core\\Migrations\\Version27000Date20230309104325' => $baseDir . '/core/Migrations/Version27000Date20230309104325.php', 'OC\\Core\\Migrations\\Version27000Date20230309104802' => $baseDir . '/core/Migrations/Version27000Date20230309104802.php', 'OC\\Core\\Migrations\\Version28000Date20230616104802' => $baseDir . '/core/Migrations/Version28000Date20230616104802.php', + 'OC\\Core\\Migrations\\Version28000Date20230728104802' => $baseDir . '/core/Migrations/Version28000Date20230728104802.php', + 'OC\\Core\\Migrations\\Version28000Date20230803221055' => $baseDir . '/core/Migrations/Version28000Date20230803221055.php', 'OC\\Core\\Notification\\CoreNotifier' => $baseDir . '/core/Notification/CoreNotifier.php', 'OC\\Core\\Service\\LoginFlowV2Service' => $baseDir . '/core/Service/LoginFlowV2Service.php', 'OC\\DB\\Adapter' => $baseDir . '/lib/private/DB/Adapter.php', @@ -1222,9 +1232,7 @@ return array( 'OC\\Encryption\\Update' => $baseDir . '/lib/private/Encryption/Update.php', 'OC\\Encryption\\Util' => $baseDir . '/lib/private/Encryption/Util.php', 'OC\\EventDispatcher\\EventDispatcher' => $baseDir . '/lib/private/EventDispatcher/EventDispatcher.php', - 'OC\\EventDispatcher\\GenericEventWrapper' => $baseDir . '/lib/private/EventDispatcher/GenericEventWrapper.php', 'OC\\EventDispatcher\\ServiceEventListener' => $baseDir . '/lib/private/EventDispatcher/ServiceEventListener.php', - 'OC\\EventDispatcher\\SymfonyAdapter' => $baseDir . '/lib/private/EventDispatcher/SymfonyAdapter.php', 'OC\\EventSourceFactory' => $baseDir . '/lib/private/EventSourceFactory.php', 'OC\\Federation\\CloudFederationFactory' => $baseDir . '/lib/private/Federation/CloudFederationFactory.php', 'OC\\Federation\\CloudFederationNotification' => $baseDir . '/lib/private/Federation/CloudFederationNotification.php', diff --git a/lib/composer/composer/autoload_static.php b/lib/composer/composer/autoload_static.php index 0e2afa8c8bd..48c6701c7c6 100644 --- a/lib/composer/composer/autoload_static.php +++ b/lib/composer/composer/autoload_static.php @@ -45,6 +45,7 @@ class ComposerStaticInit749170dad3f5e7f9ca158f5a9f04f6a2 'OCP\\Accounts\\IAccountProperty' => __DIR__ . '/../../..' . '/lib/public/Accounts/IAccountProperty.php', 'OCP\\Accounts\\IAccountPropertyCollection' => __DIR__ . '/../../..' . '/lib/public/Accounts/IAccountPropertyCollection.php', 'OCP\\Accounts\\PropertyDoesNotExistException' => __DIR__ . '/../../..' . '/lib/public/Accounts/PropertyDoesNotExistException.php', + 'OCP\\Accounts\\UserUpdatedEvent' => __DIR__ . '/../../..' . '/lib/public/Accounts/UserUpdatedEvent.php', 'OCP\\Activity\\ActivitySettings' => __DIR__ . '/../../..' . '/lib/public/Activity/ActivitySettings.php', 'OCP\\Activity\\IConsumer' => __DIR__ . '/../../..' . '/lib/public/Activity/IConsumer.php', 'OCP\\Activity\\IEvent' => __DIR__ . '/../../..' . '/lib/public/Activity/IEvent.php', @@ -342,7 +343,9 @@ class ComposerStaticInit749170dad3f5e7f9ca158f5a9f04f6a2 'OCP\\Files\\Events\\FolderScannedEvent' => __DIR__ . '/../../..' . '/lib/public/Files/Events/FolderScannedEvent.php', 'OCP\\Files\\Events\\InvalidateMountCacheEvent' => __DIR__ . '/../../..' . '/lib/public/Files/Events/InvalidateMountCacheEvent.php', 'OCP\\Files\\Events\\NodeAddedToCache' => __DIR__ . '/../../..' . '/lib/public/Files/Events/NodeAddedToCache.php', + 'OCP\\Files\\Events\\NodeAddedToFavorite' => __DIR__ . '/../../..' . '/lib/public/Files/Events/NodeAddedToFavorite.php', 'OCP\\Files\\Events\\NodeRemovedFromCache' => __DIR__ . '/../../..' . '/lib/public/Files/Events/NodeRemovedFromCache.php', + 'OCP\\Files\\Events\\NodeRemovedFromFavorite' => __DIR__ . '/../../..' . '/lib/public/Files/Events/NodeRemovedFromFavorite.php', 'OCP\\Files\\Events\\Node\\AbstractNodeEvent' => __DIR__ . '/../../..' . '/lib/public/Files/Events/Node/AbstractNodeEvent.php', 'OCP\\Files\\Events\\Node\\AbstractNodesEvent' => __DIR__ . '/../../..' . '/lib/public/Files/Events/Node/AbstractNodesEvent.php', 'OCP\\Files\\Events\\Node\\BeforeNodeCopiedEvent' => __DIR__ . '/../../..' . '/lib/public/Files/Events/Node/BeforeNodeCopiedEvent.php', @@ -616,8 +619,12 @@ class ComposerStaticInit749170dad3f5e7f9ca158f5a9f04f6a2 'OCP\\Settings\\ISettings' => __DIR__ . '/../../..' . '/lib/public/Settings/ISettings.php', 'OCP\\Settings\\ISubAdminSettings' => __DIR__ . '/../../..' . '/lib/public/Settings/ISubAdminSettings.php', 'OCP\\Share' => __DIR__ . '/../../..' . '/lib/public/Share.php', + 'OCP\\Share\\Events\\BeforeShareCreatedEvent' => __DIR__ . '/../../..' . '/lib/public/Share/Events/BeforeShareCreatedEvent.php', + 'OCP\\Share\\Events\\BeforeShareDeletedEvent' => __DIR__ . '/../../..' . '/lib/public/Share/Events/BeforeShareDeletedEvent.php', + 'OCP\\Share\\Events\\ShareAcceptedEvent' => __DIR__ . '/../../..' . '/lib/public/Share/Events/ShareAcceptedEvent.php', 'OCP\\Share\\Events\\ShareCreatedEvent' => __DIR__ . '/../../..' . '/lib/public/Share/Events/ShareCreatedEvent.php', 'OCP\\Share\\Events\\ShareDeletedEvent' => __DIR__ . '/../../..' . '/lib/public/Share/Events/ShareDeletedEvent.php', + 'OCP\\Share\\Events\\ShareDeletedFromSelfEvent' => __DIR__ . '/../../..' . '/lib/public/Share/Events/ShareDeletedFromSelfEvent.php', 'OCP\\Share\\Events\\VerifyMountPointEvent' => __DIR__ . '/../../..' . '/lib/public/Share/Events/VerifyMountPointEvent.php', 'OCP\\Share\\Exceptions\\AlreadySharedException' => __DIR__ . '/../../..' . '/lib/public/Share/Exceptions/AlreadySharedException.php', 'OCP\\Share\\Exceptions\\GenericShareException' => __DIR__ . '/../../..' . '/lib/public/Share/Exceptions/GenericShareException.php', @@ -715,6 +722,7 @@ class ComposerStaticInit749170dad3f5e7f9ca158f5a9f04f6a2 'OCP\\User\\Events\\UserChangedEvent' => __DIR__ . '/../../..' . '/lib/public/User/Events/UserChangedEvent.php', 'OCP\\User\\Events\\UserCreatedEvent' => __DIR__ . '/../../..' . '/lib/public/User/Events/UserCreatedEvent.php', 'OCP\\User\\Events\\UserDeletedEvent' => __DIR__ . '/../../..' . '/lib/public/User/Events/UserDeletedEvent.php', + 'OCP\\User\\Events\\UserFirstTimeLoggedInEvent' => __DIR__ . '/../../..' . '/lib/public/User/Events/UserFirstTimeLoggedInEvent.php', 'OCP\\User\\Events\\UserLiveStatusEvent' => __DIR__ . '/../../..' . '/lib/public/User/Events/UserLiveStatusEvent.php', 'OCP\\User\\Events\\UserLoggedInEvent' => __DIR__ . '/../../..' . '/lib/public/User/Events/UserLoggedInEvent.php', 'OCP\\User\\Events\\UserLoggedInWithCookieEvent' => __DIR__ . '/../../..' . '/lib/public/User/Events/UserLoggedInWithCookieEvent.php', @@ -1177,6 +1185,8 @@ class ComposerStaticInit749170dad3f5e7f9ca158f5a9f04f6a2 'OC\\Core\\Migrations\\Version27000Date20230309104325' => __DIR__ . '/../../..' . '/core/Migrations/Version27000Date20230309104325.php', 'OC\\Core\\Migrations\\Version27000Date20230309104802' => __DIR__ . '/../../..' . '/core/Migrations/Version27000Date20230309104802.php', 'OC\\Core\\Migrations\\Version28000Date20230616104802' => __DIR__ . '/../../..' . '/core/Migrations/Version28000Date20230616104802.php', + 'OC\\Core\\Migrations\\Version28000Date20230728104802' => __DIR__ . '/../../..' . '/core/Migrations/Version28000Date20230728104802.php', + 'OC\\Core\\Migrations\\Version28000Date20230803221055' => __DIR__ . '/../../..' . '/core/Migrations/Version28000Date20230803221055.php', 'OC\\Core\\Notification\\CoreNotifier' => __DIR__ . '/../../..' . '/core/Notification/CoreNotifier.php', 'OC\\Core\\Service\\LoginFlowV2Service' => __DIR__ . '/../../..' . '/core/Service/LoginFlowV2Service.php', 'OC\\DB\\Adapter' => __DIR__ . '/../../..' . '/lib/private/DB/Adapter.php', @@ -1255,9 +1265,7 @@ class ComposerStaticInit749170dad3f5e7f9ca158f5a9f04f6a2 'OC\\Encryption\\Update' => __DIR__ . '/../../..' . '/lib/private/Encryption/Update.php', 'OC\\Encryption\\Util' => __DIR__ . '/../../..' . '/lib/private/Encryption/Util.php', 'OC\\EventDispatcher\\EventDispatcher' => __DIR__ . '/../../..' . '/lib/private/EventDispatcher/EventDispatcher.php', - 'OC\\EventDispatcher\\GenericEventWrapper' => __DIR__ . '/../../..' . '/lib/private/EventDispatcher/GenericEventWrapper.php', 'OC\\EventDispatcher\\ServiceEventListener' => __DIR__ . '/../../..' . '/lib/private/EventDispatcher/ServiceEventListener.php', - 'OC\\EventDispatcher\\SymfonyAdapter' => __DIR__ . '/../../..' . '/lib/private/EventDispatcher/SymfonyAdapter.php', 'OC\\EventSourceFactory' => __DIR__ . '/../../..' . '/lib/private/EventSourceFactory.php', 'OC\\Federation\\CloudFederationFactory' => __DIR__ . '/../../..' . '/lib/private/Federation/CloudFederationFactory.php', 'OC\\Federation\\CloudFederationNotification' => __DIR__ . '/../../..' . '/lib/private/Federation/CloudFederationNotification.php', diff --git a/lib/l10n/ar.js b/lib/l10n/ar.js index 604f1c25ce0..3f11c0dc20b 100644 --- a/lib/l10n/ar.js +++ b/lib/l10n/ar.js @@ -264,9 +264,9 @@ OC.L10N.register( "Storage is temporarily not available" : "وحدة التخزين غير متوفرة", "Storage connection timeout. %s" : "انتهت مهلة الاتصال بالتخزين. %s", "Free prompt" : "مَحَثْ prompt مجاني", - "Runs an arbitrary prompt through the built-in language model." : "يقوم بتشغيل مَحَثْ prompt عشوائي من خلال نموذج اللغة المُضمَّن built-in language model.", + "Runs an arbitrary prompt through the language model." : "يقوم بتشغيل مَحَث عشوائي arbitrary prompt من خلال نموذج اللغة language model.", "Generate headline" : "توليد العنوان", - "Generates a possible headline for a text" : "توليد عنوان محتمل للنص", + "Generates a possible headline for a text." : "يقوم بتوليد عنوان مناسب للنص.", "Summarize" : "تلخيص", "Summarizes text by reducing its length without losing key information." : "يُلَخِّص النص بتقليل طوله دون فقدان المعنى.", "Extract topics" : "إستخلاص الموضوعات", diff --git a/lib/l10n/ar.json b/lib/l10n/ar.json index 9072f1d3226..18f77278db3 100644 --- a/lib/l10n/ar.json +++ b/lib/l10n/ar.json @@ -262,9 +262,9 @@ "Storage is temporarily not available" : "وحدة التخزين غير متوفرة", "Storage connection timeout. %s" : "انتهت مهلة الاتصال بالتخزين. %s", "Free prompt" : "مَحَثْ prompt مجاني", - "Runs an arbitrary prompt through the built-in language model." : "يقوم بتشغيل مَحَثْ prompt عشوائي من خلال نموذج اللغة المُضمَّن built-in language model.", + "Runs an arbitrary prompt through the language model." : "يقوم بتشغيل مَحَث عشوائي arbitrary prompt من خلال نموذج اللغة language model.", "Generate headline" : "توليد العنوان", - "Generates a possible headline for a text" : "توليد عنوان محتمل للنص", + "Generates a possible headline for a text." : "يقوم بتوليد عنوان مناسب للنص.", "Summarize" : "تلخيص", "Summarizes text by reducing its length without losing key information." : "يُلَخِّص النص بتقليل طوله دون فقدان المعنى.", "Extract topics" : "إستخلاص الموضوعات", diff --git a/lib/l10n/ast.js b/lib/l10n/ast.js index 4c570bbbfd7..330901f03c3 100644 --- a/lib/l10n/ast.js +++ b/lib/l10n/ast.js @@ -66,6 +66,7 @@ OC.L10N.register( "Oct." : "Och.", "Nov." : "Pay.", "Dec." : "Avi.", + "a safe home for all your data" : "un llugar seguru pa los datos personales", "Application is not enabled" : "L'aplicación nun ta activada", "Please ask your server administrator to install the module." : "Pidi a l'alministración del sirvidor qu'instale'l módulu.", "Full name" : "Nome completu" diff --git a/lib/l10n/ast.json b/lib/l10n/ast.json index 7f4c8383db1..5780dd94141 100644 --- a/lib/l10n/ast.json +++ b/lib/l10n/ast.json @@ -64,6 +64,7 @@ "Oct." : "Och.", "Nov." : "Pay.", "Dec." : "Avi.", + "a safe home for all your data" : "un llugar seguru pa los datos personales", "Application is not enabled" : "L'aplicación nun ta activada", "Please ask your server administrator to install the module." : "Pidi a l'alministración del sirvidor qu'instale'l módulu.", "Full name" : "Nome completu" diff --git a/lib/l10n/ca.js b/lib/l10n/ca.js index fa67dd41eda..f2d18db8c72 100644 --- a/lib/l10n/ca.js +++ b/lib/l10n/ca.js @@ -263,6 +263,14 @@ OC.L10N.register( "Storage connection error. %s" : "S'ha produït un error de connexió amb l'emmagatzematge. %s", "Storage is temporarily not available" : "L'emmagatzematge no està disponible temporalment", "Storage connection timeout. %s" : "S'ha superat el temps d'espera de la connexió d'emmagatzematge. %s", + "Free prompt" : "Sol·licitud lliure", + "Runs an arbitrary prompt through the language model." : "Executa una sol·licitud arbitrària mitjançant el model de llengua.", + "Generate headline" : "Genera un titular", + "Generates a possible headline for a text." : "Genera un titular possible per a un text.", + "Summarize" : "Resumeix", + "Summarizes text by reducing its length without losing key information." : "Resumeix el text reduint-ne la longitud sense perdre la informació clau.", + "Extract topics" : "Extreu els temes", + "Extracts topics from a text and outputs them separated by commas." : "Extreu els temes d'un text i els retorna separats per comes.", "The files of the app %1$s were not replaced correctly. Make sure it is a version compatible with the server." : "Els fitxers de l'aplicació %1$s no s'han substituït correctament. Assegureu-vos que sigui una versió compatible amb el servidor.", "Full name" : "Nom complet", "The user limit has been reached and the user was not created. Check your notifications to learn more." : "S'ha assolit el límit d'usuaris i no s'ha creat l'usuari. Consulteu les notificacions per a obtenir més informació.", diff --git a/lib/l10n/ca.json b/lib/l10n/ca.json index aa0f9d5e8e4..970f7d63760 100644 --- a/lib/l10n/ca.json +++ b/lib/l10n/ca.json @@ -261,6 +261,14 @@ "Storage connection error. %s" : "S'ha produït un error de connexió amb l'emmagatzematge. %s", "Storage is temporarily not available" : "L'emmagatzematge no està disponible temporalment", "Storage connection timeout. %s" : "S'ha superat el temps d'espera de la connexió d'emmagatzematge. %s", + "Free prompt" : "Sol·licitud lliure", + "Runs an arbitrary prompt through the language model." : "Executa una sol·licitud arbitrària mitjançant el model de llengua.", + "Generate headline" : "Genera un titular", + "Generates a possible headline for a text." : "Genera un titular possible per a un text.", + "Summarize" : "Resumeix", + "Summarizes text by reducing its length without losing key information." : "Resumeix el text reduint-ne la longitud sense perdre la informació clau.", + "Extract topics" : "Extreu els temes", + "Extracts topics from a text and outputs them separated by commas." : "Extreu els temes d'un text i els retorna separats per comes.", "The files of the app %1$s were not replaced correctly. Make sure it is a version compatible with the server." : "Els fitxers de l'aplicació %1$s no s'han substituït correctament. Assegureu-vos que sigui una versió compatible amb el servidor.", "Full name" : "Nom complet", "The user limit has been reached and the user was not created. Check your notifications to learn more." : "S'ha assolit el límit d'usuaris i no s'ha creat l'usuari. Consulteu les notificacions per a obtenir més informació.", diff --git a/lib/l10n/cs.js b/lib/l10n/cs.js index 809807bae7b..6621e4cd6e9 100644 --- a/lib/l10n/cs.js +++ b/lib/l10n/cs.js @@ -264,9 +264,8 @@ OC.L10N.register( "Storage is temporarily not available" : "Úložiště je dočasně nedostupné", "Storage connection timeout. %s" : "Překročen časový limit připojování k úložišti. %s", "Free prompt" : "Prompt zdarma", - "Runs an arbitrary prompt through the built-in language model." : "Spouští libovolný prompt prostřednictvím vestavěného jazykového modelu.", "Generate headline" : "Vytvořit nadpis", - "Generates a possible headline for a text" : "Vytvoří možný nadpis pro text", + "Generates a possible headline for a text." : "Vytvoří možný nadpis pro text.", "Summarize" : "Stručný souhrn", "Summarizes text by reducing its length without losing key information." : "Vytvoří stručný souhrn textu tím, že zkrátí jeho délku aniž by byly ztraceny klíčové informace", "Extract topics" : "Vyzískat témata", diff --git a/lib/l10n/cs.json b/lib/l10n/cs.json index d05c7df56ce..d1434a968c7 100644 --- a/lib/l10n/cs.json +++ b/lib/l10n/cs.json @@ -262,9 +262,8 @@ "Storage is temporarily not available" : "Úložiště je dočasně nedostupné", "Storage connection timeout. %s" : "Překročen časový limit připojování k úložišti. %s", "Free prompt" : "Prompt zdarma", - "Runs an arbitrary prompt through the built-in language model." : "Spouští libovolný prompt prostřednictvím vestavěného jazykového modelu.", "Generate headline" : "Vytvořit nadpis", - "Generates a possible headline for a text" : "Vytvoří možný nadpis pro text", + "Generates a possible headline for a text." : "Vytvoří možný nadpis pro text.", "Summarize" : "Stručný souhrn", "Summarizes text by reducing its length without losing key information." : "Vytvoří stručný souhrn textu tím, že zkrátí jeho délku aniž by byly ztraceny klíčové informace", "Extract topics" : "Vyzískat témata", diff --git a/lib/l10n/da.js b/lib/l10n/da.js index ed73275fed9..678f4de73f1 100644 --- a/lib/l10n/da.js +++ b/lib/l10n/da.js @@ -5,6 +5,7 @@ OC.L10N.register( "This can usually be fixed by giving the web server write access to the config directory." : "Dette kan normalt rettes ved at give webserveren skriveadgang til config folderen.", "But, if you prefer to keep config.php file read only, set the option \"config_is_read_only\" to true in it." : "Men hvis du foretrækker at bibeholde config.php skrivebeskyttet, så sæt parameter \"config_is_read_only\" til true i filen. ", "See %s" : "Se %s", + "Application %1$s is not present or has a non-compatible version with this server. Please check the apps directory." : "Applikationen %1$s er ikke til stede eller har en ikke-kompatibel version med denne server. Tjek venligst apps mappen.", "Sample configuration detected" : "Eksempel for konfiguration registreret", "It has been detected that the sample configuration has been copied. This can break your installation and is unsupported. Please read the documentation before performing changes on config.php" : "Der er registreret at konfigurations eksemplet er blevet kopieret direkte. Dette kan ødelægge din installation og understøttes ikke. Læs venligst dokumentationen før der foretages ændringer i config.php", "404" : "404", @@ -57,6 +58,7 @@ OC.L10N.register( "Avatar image is not square" : "Avatar billedet er ikke kvadratisk", "Files" : "Filer", "View profile" : "Vis profil", + "Local time: %s" : "Lokal tid: %s", "today" : "i dag", "tomorrow" : "i morgen", "yesterday" : "i går", @@ -101,6 +103,8 @@ OC.L10N.register( "Users" : "Brugere", "Email" : "E-mail", "Mail %s" : "Mail %s", + "Fediverse" : "Fediverse", + "View %s on the fediverse" : "Vis %s på fediverset", "Phone" : "Telefon", "Call %s" : "Ring op %s", "Twitter" : "Twitter", @@ -152,6 +156,7 @@ OC.L10N.register( "%1$s shared »%2$s« with you." : "%1$s delte »%2$s« med dig", "Click the button below to open it." : "Klik på knappen nedenunder for at åbne.", "The requested share does not exist anymore" : "Det delte emne eksisterer ikke længere", + "The user was not created because the user limit has been reached. Check your notifications to learn more." : "Brugeren blev ikke oprettet, fordi brugergrænsen er nået. Tjek dine notifikationer for at få flere oplysninger.", "Could not find category \"%s\"" : "Kunne ikke finde kategorien \"%s\"", "Sunday" : "Søndag", "Monday" : "Mandag", @@ -201,6 +206,7 @@ OC.L10N.register( "A valid password must be provided" : "En gyldig adgangskode skal angives", "The username is already being used" : "Brugernavnet er allerede i brug", "Could not create user" : "Kunne ikke oprette bruger", + "Only the following characters are allowed in a username: \"a-z\", \"A-Z\", \"0-9\", spaces and \"_.@-'\"" : "Kun følgende tegn kan indgå i et brugernavn: \"a-z\", \"A-Z\", \"0-9\", mellemrum and \"_.@-'\"", "A valid username must be provided" : "Et gyldigt brugernavn skal angives", "Username contains whitespace at the beginning or at the end" : "Brugernavnet har et mellemrum i starten eller slutningen", "Username must not consist of dots only" : "Brugernavnet må ikke bestå af rene prikker/punktummer", @@ -257,6 +263,14 @@ OC.L10N.register( "Storage connection error. %s" : "Forbindelses fejl til lageret. %s", "Storage is temporarily not available" : "Lagerplads er midlertidigt ikke tilgængeligt", "Storage connection timeout. %s" : "Lageret svarer ikke. %s", + "Free prompt" : "Gratis prompt", + "Runs an arbitrary prompt through the language model." : "Kører en arbitrær prompt gennem sprogmodellen.", + "Generate headline" : "Generer overskrift", + "Generates a possible headline for a text." : "Genererer en mulig overskrift til en tekst.", + "Summarize" : "Opsummer", + "Summarizes text by reducing its length without losing key information." : "Opsummerer tekst ved at reducere dens længde uden at miste nøgleinformation.", + "Extract topics" : "Uddrag emner", + "Extracts topics from a text and outputs them separated by commas." : "Uddrager emner fra en tekst og skriver dem adskilt af kommaer.", "The files of the app %1$s were not replaced correctly. Make sure it is a version compatible with the server." : "Filerne tilhørende appen %1$s blev ikke erstattet korrekt. Check at versionen er kompatibel med serveren.", "Full name" : "Fulde navn", "The user limit has been reached and the user was not created. Check your notifications to learn more." : "Grænsen for brugere er nået, og den nye bruger er ikke blevet oprettet. Læs dine notifikationer for at lære mere.", diff --git a/lib/l10n/da.json b/lib/l10n/da.json index d30cf76d846..bd4cd890bfd 100644 --- a/lib/l10n/da.json +++ b/lib/l10n/da.json @@ -3,6 +3,7 @@ "This can usually be fixed by giving the web server write access to the config directory." : "Dette kan normalt rettes ved at give webserveren skriveadgang til config folderen.", "But, if you prefer to keep config.php file read only, set the option \"config_is_read_only\" to true in it." : "Men hvis du foretrækker at bibeholde config.php skrivebeskyttet, så sæt parameter \"config_is_read_only\" til true i filen. ", "See %s" : "Se %s", + "Application %1$s is not present or has a non-compatible version with this server. Please check the apps directory." : "Applikationen %1$s er ikke til stede eller har en ikke-kompatibel version med denne server. Tjek venligst apps mappen.", "Sample configuration detected" : "Eksempel for konfiguration registreret", "It has been detected that the sample configuration has been copied. This can break your installation and is unsupported. Please read the documentation before performing changes on config.php" : "Der er registreret at konfigurations eksemplet er blevet kopieret direkte. Dette kan ødelægge din installation og understøttes ikke. Læs venligst dokumentationen før der foretages ændringer i config.php", "404" : "404", @@ -55,6 +56,7 @@ "Avatar image is not square" : "Avatar billedet er ikke kvadratisk", "Files" : "Filer", "View profile" : "Vis profil", + "Local time: %s" : "Lokal tid: %s", "today" : "i dag", "tomorrow" : "i morgen", "yesterday" : "i går", @@ -99,6 +101,8 @@ "Users" : "Brugere", "Email" : "E-mail", "Mail %s" : "Mail %s", + "Fediverse" : "Fediverse", + "View %s on the fediverse" : "Vis %s på fediverset", "Phone" : "Telefon", "Call %s" : "Ring op %s", "Twitter" : "Twitter", @@ -150,6 +154,7 @@ "%1$s shared »%2$s« with you." : "%1$s delte »%2$s« med dig", "Click the button below to open it." : "Klik på knappen nedenunder for at åbne.", "The requested share does not exist anymore" : "Det delte emne eksisterer ikke længere", + "The user was not created because the user limit has been reached. Check your notifications to learn more." : "Brugeren blev ikke oprettet, fordi brugergrænsen er nået. Tjek dine notifikationer for at få flere oplysninger.", "Could not find category \"%s\"" : "Kunne ikke finde kategorien \"%s\"", "Sunday" : "Søndag", "Monday" : "Mandag", @@ -199,6 +204,7 @@ "A valid password must be provided" : "En gyldig adgangskode skal angives", "The username is already being used" : "Brugernavnet er allerede i brug", "Could not create user" : "Kunne ikke oprette bruger", + "Only the following characters are allowed in a username: \"a-z\", \"A-Z\", \"0-9\", spaces and \"_.@-'\"" : "Kun følgende tegn kan indgå i et brugernavn: \"a-z\", \"A-Z\", \"0-9\", mellemrum and \"_.@-'\"", "A valid username must be provided" : "Et gyldigt brugernavn skal angives", "Username contains whitespace at the beginning or at the end" : "Brugernavnet har et mellemrum i starten eller slutningen", "Username must not consist of dots only" : "Brugernavnet må ikke bestå af rene prikker/punktummer", @@ -255,6 +261,14 @@ "Storage connection error. %s" : "Forbindelses fejl til lageret. %s", "Storage is temporarily not available" : "Lagerplads er midlertidigt ikke tilgængeligt", "Storage connection timeout. %s" : "Lageret svarer ikke. %s", + "Free prompt" : "Gratis prompt", + "Runs an arbitrary prompt through the language model." : "Kører en arbitrær prompt gennem sprogmodellen.", + "Generate headline" : "Generer overskrift", + "Generates a possible headline for a text." : "Genererer en mulig overskrift til en tekst.", + "Summarize" : "Opsummer", + "Summarizes text by reducing its length without losing key information." : "Opsummerer tekst ved at reducere dens længde uden at miste nøgleinformation.", + "Extract topics" : "Uddrag emner", + "Extracts topics from a text and outputs them separated by commas." : "Uddrager emner fra en tekst og skriver dem adskilt af kommaer.", "The files of the app %1$s were not replaced correctly. Make sure it is a version compatible with the server." : "Filerne tilhørende appen %1$s blev ikke erstattet korrekt. Check at versionen er kompatibel med serveren.", "Full name" : "Fulde navn", "The user limit has been reached and the user was not created. Check your notifications to learn more." : "Grænsen for brugere er nået, og den nye bruger er ikke blevet oprettet. Læs dine notifikationer for at lære mere.", diff --git a/lib/l10n/de_DE.js b/lib/l10n/de_DE.js index eda9b551120..391cf768e60 100644 --- a/lib/l10n/de_DE.js +++ b/lib/l10n/de_DE.js @@ -55,7 +55,7 @@ OC.L10N.register( "Authentication" : "Authentifizierung", "Unknown filetype" : "Unbekannter Dateityp", "Invalid image" : "Ungültiges Bild", - "Avatar image is not square" : "Benutzerbild ist nicht quadratisch", + "Avatar image is not square" : "Avatar-Bild ist nicht quadratisch", "Files" : "Dateien", "View profile" : "Profil ansehen", "Local time: %s" : "Ortszeit: %s", @@ -264,9 +264,9 @@ OC.L10N.register( "Storage is temporarily not available" : "Speicher ist vorübergehend nicht verfügbar", "Storage connection timeout. %s" : "Zeitüberschreitung der Verbindung zum Speicherplatz. %s", "Free prompt" : "Freie Eingabeaufforderung", - "Runs an arbitrary prompt through the built-in language model." : "Führt eine beliebige Eingabeaufforderung über das integrierte Sprachmodell aus.", + "Runs an arbitrary prompt through the language model." : "Führt eine beliebige Eingabeaufforderung über das Sprachmodell aus.", "Generate headline" : "Kopfzeile erzeugen", - "Generates a possible headline for a text" : "Erzeugt eine mögliche Überschrift für einen Text", + "Generates a possible headline for a text." : "Erzeugt eine mögliche Überschrift für einen Text.", "Summarize" : "Zusammenfassen", "Summarizes text by reducing its length without losing key information." : "Fasst Text zusammen, indem die Länge reduziert wird, ohne dass wichtige Informationen verloren gehen.", "Extract topics" : "Themen extrahieren", diff --git a/lib/l10n/de_DE.json b/lib/l10n/de_DE.json index 477c67617b8..84c4f02f5a0 100644 --- a/lib/l10n/de_DE.json +++ b/lib/l10n/de_DE.json @@ -53,7 +53,7 @@ "Authentication" : "Authentifizierung", "Unknown filetype" : "Unbekannter Dateityp", "Invalid image" : "Ungültiges Bild", - "Avatar image is not square" : "Benutzerbild ist nicht quadratisch", + "Avatar image is not square" : "Avatar-Bild ist nicht quadratisch", "Files" : "Dateien", "View profile" : "Profil ansehen", "Local time: %s" : "Ortszeit: %s", @@ -262,9 +262,9 @@ "Storage is temporarily not available" : "Speicher ist vorübergehend nicht verfügbar", "Storage connection timeout. %s" : "Zeitüberschreitung der Verbindung zum Speicherplatz. %s", "Free prompt" : "Freie Eingabeaufforderung", - "Runs an arbitrary prompt through the built-in language model." : "Führt eine beliebige Eingabeaufforderung über das integrierte Sprachmodell aus.", + "Runs an arbitrary prompt through the language model." : "Führt eine beliebige Eingabeaufforderung über das Sprachmodell aus.", "Generate headline" : "Kopfzeile erzeugen", - "Generates a possible headline for a text" : "Erzeugt eine mögliche Überschrift für einen Text", + "Generates a possible headline for a text." : "Erzeugt eine mögliche Überschrift für einen Text.", "Summarize" : "Zusammenfassen", "Summarizes text by reducing its length without losing key information." : "Fasst Text zusammen, indem die Länge reduziert wird, ohne dass wichtige Informationen verloren gehen.", "Extract topics" : "Themen extrahieren", diff --git a/lib/l10n/en_GB.js b/lib/l10n/en_GB.js index 6be3cb74991..8fe43e7bf31 100644 --- a/lib/l10n/en_GB.js +++ b/lib/l10n/en_GB.js @@ -264,9 +264,9 @@ OC.L10N.register( "Storage is temporarily not available" : "Storage is temporarily not available", "Storage connection timeout. %s" : "Storage connection timeout. %s", "Free prompt" : "Free prompt", - "Runs an arbitrary prompt through the built-in language model." : "Runs an arbitrary prompt through the built-in language model.", + "Runs an arbitrary prompt through the language model." : "Runs an arbitrary prompt through the language model.", "Generate headline" : "Generate headline", - "Generates a possible headline for a text" : "Generates a possible headline for a text", + "Generates a possible headline for a text." : "Generates a possible headline for a text.", "Summarize" : "Summarise", "Summarizes text by reducing its length without losing key information." : "Summarizes text by reducing its length without losing key information.", "Extract topics" : "Extract topics", diff --git a/lib/l10n/en_GB.json b/lib/l10n/en_GB.json index 43b39d6710b..addf208cd88 100644 --- a/lib/l10n/en_GB.json +++ b/lib/l10n/en_GB.json @@ -262,9 +262,9 @@ "Storage is temporarily not available" : "Storage is temporarily not available", "Storage connection timeout. %s" : "Storage connection timeout. %s", "Free prompt" : "Free prompt", - "Runs an arbitrary prompt through the built-in language model." : "Runs an arbitrary prompt through the built-in language model.", + "Runs an arbitrary prompt through the language model." : "Runs an arbitrary prompt through the language model.", "Generate headline" : "Generate headline", - "Generates a possible headline for a text" : "Generates a possible headline for a text", + "Generates a possible headline for a text." : "Generates a possible headline for a text.", "Summarize" : "Summarise", "Summarizes text by reducing its length without losing key information." : "Summarizes text by reducing its length without losing key information.", "Extract topics" : "Extract topics", diff --git a/lib/l10n/es.js b/lib/l10n/es.js index 08d752960a3..f00519ce823 100644 --- a/lib/l10n/es.js +++ b/lib/l10n/es.js @@ -263,6 +263,13 @@ OC.L10N.register( "Storage connection error. %s" : "Error de conexión de almacenamiento. %s", "Storage is temporarily not available" : "El almacenamiento no esta disponible temporalmente", "Storage connection timeout. %s" : "Tiempo de conexión de almacenamiento agotado. %s", + "Free prompt" : "Prompt libre", + "Generate headline" : "Generar titular", + "Generates a possible headline for a text." : "Genera un posible titular para un texto.", + "Summarize" : "Resumir", + "Summarizes text by reducing its length without losing key information." : "Resume el texto reduciendo su longitud sin perder información clave.", + "Extract topics" : "Extraer tópicos", + "Extracts topics from a text and outputs them separated by commas." : "Extrae los tópicos de un texto y genera una salida separada por comas. ", "The files of the app %1$s were not replaced correctly. Make sure it is a version compatible with the server." : "Los archivos de la app %1$s no se han reemplazado correctamente. Asegúrate de que es una versión compatible con el servidor.", "Full name" : "Nombre completo", "The user limit has been reached and the user was not created. Check your notifications to learn more." : "El límite de usuarios fue alcanzado y el usuario no fue creado. Compruebe sus notificaciones para aprender más.", diff --git a/lib/l10n/es.json b/lib/l10n/es.json index 1def3530daf..edbdae8acef 100644 --- a/lib/l10n/es.json +++ b/lib/l10n/es.json @@ -261,6 +261,13 @@ "Storage connection error. %s" : "Error de conexión de almacenamiento. %s", "Storage is temporarily not available" : "El almacenamiento no esta disponible temporalmente", "Storage connection timeout. %s" : "Tiempo de conexión de almacenamiento agotado. %s", + "Free prompt" : "Prompt libre", + "Generate headline" : "Generar titular", + "Generates a possible headline for a text." : "Genera un posible titular para un texto.", + "Summarize" : "Resumir", + "Summarizes text by reducing its length without losing key information." : "Resume el texto reduciendo su longitud sin perder información clave.", + "Extract topics" : "Extraer tópicos", + "Extracts topics from a text and outputs them separated by commas." : "Extrae los tópicos de un texto y genera una salida separada por comas. ", "The files of the app %1$s were not replaced correctly. Make sure it is a version compatible with the server." : "Los archivos de la app %1$s no se han reemplazado correctamente. Asegúrate de que es una versión compatible con el servidor.", "Full name" : "Nombre completo", "The user limit has been reached and the user was not created. Check your notifications to learn more." : "El límite de usuarios fue alcanzado y el usuario no fue creado. Compruebe sus notificaciones para aprender más.", diff --git a/lib/l10n/eu.js b/lib/l10n/eu.js index 48d0acecb08..eb73413fc8e 100644 --- a/lib/l10n/eu.js +++ b/lib/l10n/eu.js @@ -263,6 +263,13 @@ OC.L10N.register( "Storage connection error. %s" : "Biltegiratze-konexioaren errorea. %s", "Storage is temporarily not available" : "Biltegia ez dago erabilgarri aldi baterako", "Storage connection timeout. %s" : "Biltegiratze-konexioa denboraz kanpo geratu da. %s", + "Free prompt" : "Gonbita librea", + "Generate headline" : "Sortu izenburua", + "Generates a possible headline for a text." : "Testu baten izenburu posiblea sortzen du.", + "Summarize" : "Laburtu", + "Summarizes text by reducing its length without losing key information." : "Testua laburtzen du bere luzera murrizten informazio baliotsua galdu gabe.", + "Extract topics" : "Atera gaiak", + "Extracts topics from a text and outputs them separated by commas." : "Gaiak ateratzen ditu testu batetik eta komaz banatuta erakusten ditu.", "The files of the app %1$s were not replaced correctly. Make sure it is a version compatible with the server." : "%1$s aplikazioaren fitxategiak ez dira behar bezala ordezkatu. Ziurtatu zerbitzariarekin bateragarria den bertsioa dela.", "Full name" : "Izen osoa", "The user limit has been reached and the user was not created. Check your notifications to learn more." : "Ezin izan da erabiltzailea sortu, erabiltzaile muga gainditu delako. Egiaztatu zure jakinarazpenak gehiago jakiteko.", diff --git a/lib/l10n/eu.json b/lib/l10n/eu.json index bb48899e82a..d71ac7083fe 100644 --- a/lib/l10n/eu.json +++ b/lib/l10n/eu.json @@ -261,6 +261,13 @@ "Storage connection error. %s" : "Biltegiratze-konexioaren errorea. %s", "Storage is temporarily not available" : "Biltegia ez dago erabilgarri aldi baterako", "Storage connection timeout. %s" : "Biltegiratze-konexioa denboraz kanpo geratu da. %s", + "Free prompt" : "Gonbita librea", + "Generate headline" : "Sortu izenburua", + "Generates a possible headline for a text." : "Testu baten izenburu posiblea sortzen du.", + "Summarize" : "Laburtu", + "Summarizes text by reducing its length without losing key information." : "Testua laburtzen du bere luzera murrizten informazio baliotsua galdu gabe.", + "Extract topics" : "Atera gaiak", + "Extracts topics from a text and outputs them separated by commas." : "Gaiak ateratzen ditu testu batetik eta komaz banatuta erakusten ditu.", "The files of the app %1$s were not replaced correctly. Make sure it is a version compatible with the server." : "%1$s aplikazioaren fitxategiak ez dira behar bezala ordezkatu. Ziurtatu zerbitzariarekin bateragarria den bertsioa dela.", "Full name" : "Izen osoa", "The user limit has been reached and the user was not created. Check your notifications to learn more." : "Ezin izan da erabiltzailea sortu, erabiltzaile muga gainditu delako. Egiaztatu zure jakinarazpenak gehiago jakiteko.", diff --git a/lib/l10n/gl.js b/lib/l10n/gl.js index d837885ae19..5e4031ae12e 100644 --- a/lib/l10n/gl.js +++ b/lib/l10n/gl.js @@ -236,9 +236,9 @@ OC.L10N.register( "Please ask your server administrator to install the module." : "Pídalle á administración do seu servidor que instale o módulo.", "PHP setting \"%s\" is not set to \"%s\"." : "O axuste de PHP «%s» non está estabelecido a «%s».", "Adjusting this setting in php.ini will make Nextcloud run again" : "Cambiar este axuste no ficheiro php.ini fará que Nextcloud funcione de novo", - "<code>mbstring.func_overload</code> is set to <code>%s</code> instead of the expected value <code>0</code>." : "<code>mbstring.func_overload</code> está definido en <code>%s</code> no canto do valor agardado <code>0</code>.", + "<code>mbstring.func_overload</code> is set to <code>%s</code> instead of the expected value <code>0</code>." : "<code>mbstring.func_overload</code> está estabelecido en <code>%s</code> no canto do valor agardado <code>0</code>.", "To fix this issue set <code>mbstring.func_overload</code> to <code>0</code> in your php.ini." : "Para solucionar este problema, estabeleza <code>mbstring.func_overload</code> en <code>0</code> no seu php.ini.", - "PHP is apparently set up to strip inline doc blocks. This will make several core apps inaccessible." : "Semella que PHP foi configurado para quitar bloques de documentos en liña. Isto fará que varias aplicacións sexan inaccesíbeis.", + "PHP is apparently set up to strip inline doc blocks. This will make several core apps inaccessible." : "Semella que PHP foi configurado para quitar bloques de documentos en liña. Isto fará que varios aplicativos sexan inaccesíbeis. ", "This is probably caused by a cache/accelerator such as Zend OPcache or eAccelerator." : "Isto probabelmente se debe unha caché/acelerador como Zend OPcache ou eAccelerator.", "PHP modules have been installed, but they are still listed as missing?" : "Instaláronse os módulos de PHP, mais aínda aparecen listados como perdidos?", "Please ask your server administrator to restart the web server." : "Pídalle á administración do seu servidor que reinicie o servidor web.", @@ -264,9 +264,9 @@ OC.L10N.register( "Storage is temporarily not available" : "O almacenamento non está dispoñíbel temporalmente", "Storage connection timeout. %s" : "Esgotouse o tempo de conexión co almacenamento. %s", "Free prompt" : "Indicación libre", - "Runs an arbitrary prompt through the built-in language model." : "Procesa unha indicación arbitraria a través do modelo de linguaxe integrado.", + "Runs an arbitrary prompt through the language model." : "Procesa unha indicación arbitraria a través do modelo de linguaxe.", "Generate headline" : "Xerar título", - "Generates a possible headline for a text" : "Xera un posíbel título para un texto", + "Generates a possible headline for a text." : "Xera un posíbel título para un texto.", "Summarize" : "Resumir", "Summarizes text by reducing its length without losing key information." : "Resume o texto reducindo a súa lonxitude sen perder a información clave.", "Extract topics" : "Extraer temas", diff --git a/lib/l10n/gl.json b/lib/l10n/gl.json index c463d3ab3a2..64cfb001183 100644 --- a/lib/l10n/gl.json +++ b/lib/l10n/gl.json @@ -234,9 +234,9 @@ "Please ask your server administrator to install the module." : "Pídalle á administración do seu servidor que instale o módulo.", "PHP setting \"%s\" is not set to \"%s\"." : "O axuste de PHP «%s» non está estabelecido a «%s».", "Adjusting this setting in php.ini will make Nextcloud run again" : "Cambiar este axuste no ficheiro php.ini fará que Nextcloud funcione de novo", - "<code>mbstring.func_overload</code> is set to <code>%s</code> instead of the expected value <code>0</code>." : "<code>mbstring.func_overload</code> está definido en <code>%s</code> no canto do valor agardado <code>0</code>.", + "<code>mbstring.func_overload</code> is set to <code>%s</code> instead of the expected value <code>0</code>." : "<code>mbstring.func_overload</code> está estabelecido en <code>%s</code> no canto do valor agardado <code>0</code>.", "To fix this issue set <code>mbstring.func_overload</code> to <code>0</code> in your php.ini." : "Para solucionar este problema, estabeleza <code>mbstring.func_overload</code> en <code>0</code> no seu php.ini.", - "PHP is apparently set up to strip inline doc blocks. This will make several core apps inaccessible." : "Semella que PHP foi configurado para quitar bloques de documentos en liña. Isto fará que varias aplicacións sexan inaccesíbeis.", + "PHP is apparently set up to strip inline doc blocks. This will make several core apps inaccessible." : "Semella que PHP foi configurado para quitar bloques de documentos en liña. Isto fará que varios aplicativos sexan inaccesíbeis. ", "This is probably caused by a cache/accelerator such as Zend OPcache or eAccelerator." : "Isto probabelmente se debe unha caché/acelerador como Zend OPcache ou eAccelerator.", "PHP modules have been installed, but they are still listed as missing?" : "Instaláronse os módulos de PHP, mais aínda aparecen listados como perdidos?", "Please ask your server administrator to restart the web server." : "Pídalle á administración do seu servidor que reinicie o servidor web.", @@ -262,9 +262,9 @@ "Storage is temporarily not available" : "O almacenamento non está dispoñíbel temporalmente", "Storage connection timeout. %s" : "Esgotouse o tempo de conexión co almacenamento. %s", "Free prompt" : "Indicación libre", - "Runs an arbitrary prompt through the built-in language model." : "Procesa unha indicación arbitraria a través do modelo de linguaxe integrado.", + "Runs an arbitrary prompt through the language model." : "Procesa unha indicación arbitraria a través do modelo de linguaxe.", "Generate headline" : "Xerar título", - "Generates a possible headline for a text" : "Xera un posíbel título para un texto", + "Generates a possible headline for a text." : "Xera un posíbel título para un texto.", "Summarize" : "Resumir", "Summarizes text by reducing its length without losing key information." : "Resume o texto reducindo a súa lonxitude sen perder a información clave.", "Extract topics" : "Extraer temas", diff --git a/lib/l10n/it.js b/lib/l10n/it.js index 7ab5186cde5..f850c2ff13f 100644 --- a/lib/l10n/it.js +++ b/lib/l10n/it.js @@ -264,9 +264,9 @@ OC.L10N.register( "Storage is temporarily not available" : "L'archiviazione è temporaneamente non disponibile", "Storage connection timeout. %s" : "Timeout di connessione all'archiviazione. %s", "Free prompt" : "Prompt libero", - "Runs an arbitrary prompt through the built-in language model." : "Esegue un prompt arbitrario attraverso il modello di lingua integrato.", + "Runs an arbitrary prompt through the language model." : "Esegue un prompt arbitrario attraverso il modello di lingua.", "Generate headline" : "Genera titolo", - "Generates a possible headline for a text" : "Genera un possibile titolo per un testo", + "Generates a possible headline for a text." : "Genera un possibile titolo per un testo.", "Summarize" : "Riassumi", "Summarizes text by reducing its length without losing key information." : "Riassume il testo riducendone la lunghezza senza perdere le informazioni chiave.", "Extract topics" : "Estrai argomenti", diff --git a/lib/l10n/it.json b/lib/l10n/it.json index 0d4199d4ce8..7671837d816 100644 --- a/lib/l10n/it.json +++ b/lib/l10n/it.json @@ -262,9 +262,9 @@ "Storage is temporarily not available" : "L'archiviazione è temporaneamente non disponibile", "Storage connection timeout. %s" : "Timeout di connessione all'archiviazione. %s", "Free prompt" : "Prompt libero", - "Runs an arbitrary prompt through the built-in language model." : "Esegue un prompt arbitrario attraverso il modello di lingua integrato.", + "Runs an arbitrary prompt through the language model." : "Esegue un prompt arbitrario attraverso il modello di lingua.", "Generate headline" : "Genera titolo", - "Generates a possible headline for a text" : "Genera un possibile titolo per un testo", + "Generates a possible headline for a text." : "Genera un possibile titolo per un testo.", "Summarize" : "Riassumi", "Summarizes text by reducing its length without losing key information." : "Riassume il testo riducendone la lunghezza senza perdere le informazioni chiave.", "Extract topics" : "Estrai argomenti", diff --git a/lib/l10n/pt_BR.js b/lib/l10n/pt_BR.js index d236dfd61c8..0fe0dc30f29 100644 --- a/lib/l10n/pt_BR.js +++ b/lib/l10n/pt_BR.js @@ -264,9 +264,8 @@ OC.L10N.register( "Storage is temporarily not available" : "Armazenamento temporariamente indisponível", "Storage connection timeout. %s" : "Atingido o tempo limite de conexão ao armazenamento. %s", "Free prompt" : "Solicitação gratuita", - "Runs an arbitrary prompt through the built-in language model." : "Executa um prompt arbitrário por meio do modelo de idioma integrado.", "Generate headline" : "Gerar título", - "Generates a possible headline for a text" : "Gera um título possível para um texto", + "Generates a possible headline for a text." : "Gera um título possível para um texto.", "Summarize" : "Resumir", "Summarizes text by reducing its length without losing key information." : "Resume o texto reduzindo seu comprimento sem perder informações importantes.", "Extract topics" : "Extrair tópicos", diff --git a/lib/l10n/pt_BR.json b/lib/l10n/pt_BR.json index 2c7742d1bd2..90c78bde965 100644 --- a/lib/l10n/pt_BR.json +++ b/lib/l10n/pt_BR.json @@ -262,9 +262,8 @@ "Storage is temporarily not available" : "Armazenamento temporariamente indisponível", "Storage connection timeout. %s" : "Atingido o tempo limite de conexão ao armazenamento. %s", "Free prompt" : "Solicitação gratuita", - "Runs an arbitrary prompt through the built-in language model." : "Executa um prompt arbitrário por meio do modelo de idioma integrado.", "Generate headline" : "Gerar título", - "Generates a possible headline for a text" : "Gera um título possível para um texto", + "Generates a possible headline for a text." : "Gera um título possível para um texto.", "Summarize" : "Resumir", "Summarizes text by reducing its length without losing key information." : "Resume o texto reduzindo seu comprimento sem perder informações importantes.", "Extract topics" : "Extrair tópicos", diff --git a/lib/l10n/sv.js b/lib/l10n/sv.js index 4fc5b53779d..7f8171f41fe 100644 --- a/lib/l10n/sv.js +++ b/lib/l10n/sv.js @@ -264,7 +264,7 @@ OC.L10N.register( "Storage is temporarily not available" : "Lagringsutrymme är för tillfället inte tillgängligt", "Storage connection timeout. %s" : "Lagringsutrymme lyckas inte ansluta \"timeout\". %s", "Generate headline" : "Skapa rubrik", - "Generates a possible headline for a text" : "Genererar en möjlig rubrik för en text", + "Generates a possible headline for a text." : "Genererar en möjlig rubrik för en text.", "Summarize" : "Sammanfatta", "Summarizes text by reducing its length without losing key information." : "Sammanfattar text genom att minska dess längd utan att förlora viktig information.", "Extract topics" : "Extrahera ämnen", diff --git a/lib/l10n/sv.json b/lib/l10n/sv.json index 8e33566961a..5f814b99742 100644 --- a/lib/l10n/sv.json +++ b/lib/l10n/sv.json @@ -262,7 +262,7 @@ "Storage is temporarily not available" : "Lagringsutrymme är för tillfället inte tillgängligt", "Storage connection timeout. %s" : "Lagringsutrymme lyckas inte ansluta \"timeout\". %s", "Generate headline" : "Skapa rubrik", - "Generates a possible headline for a text" : "Genererar en möjlig rubrik för en text", + "Generates a possible headline for a text." : "Genererar en möjlig rubrik för en text.", "Summarize" : "Sammanfatta", "Summarizes text by reducing its length without losing key information." : "Sammanfattar text genom att minska dess längd utan att förlora viktig information.", "Extract topics" : "Extrahera ämnen", diff --git a/lib/l10n/tr.js b/lib/l10n/tr.js index 98c3415025a..d20d541dc59 100644 --- a/lib/l10n/tr.js +++ b/lib/l10n/tr.js @@ -264,9 +264,9 @@ OC.L10N.register( "Storage is temporarily not available" : "Depolama geçici olarak kullanılamıyor", "Storage connection timeout. %s" : "Depolama bağlantısı zaman aşımı. %s", "Free prompt" : "Ücretsiz bilgi istemi", - "Runs an arbitrary prompt through the built-in language model." : "Yerleşik dil modeli ile isteğe bağlı bir bilgi istemi çalıştırır.", + "Runs an arbitrary prompt through the language model." : "Dil modeli ile isteğe bağlı bir bilgi istemi çalıştırır.", "Generate headline" : "Başlık oluşturulsun", - "Generates a possible headline for a text" : "Bir metin için olası bir başlık oluşturur", + "Generates a possible headline for a text." : "Bir metin için olası bir başlık oluşturur.", "Summarize" : "Özetlensin", "Summarizes text by reducing its length without losing key information." : "Temel içeriği kaybetmeden uzunluğunu kısaltarak metni özetler.", "Extract topics" : "Başlıklar ayıklansın", diff --git a/lib/l10n/tr.json b/lib/l10n/tr.json index 0a3b4468fc2..4062f3b81e5 100644 --- a/lib/l10n/tr.json +++ b/lib/l10n/tr.json @@ -262,9 +262,9 @@ "Storage is temporarily not available" : "Depolama geçici olarak kullanılamıyor", "Storage connection timeout. %s" : "Depolama bağlantısı zaman aşımı. %s", "Free prompt" : "Ücretsiz bilgi istemi", - "Runs an arbitrary prompt through the built-in language model." : "Yerleşik dil modeli ile isteğe bağlı bir bilgi istemi çalıştırır.", + "Runs an arbitrary prompt through the language model." : "Dil modeli ile isteğe bağlı bir bilgi istemi çalıştırır.", "Generate headline" : "Başlık oluşturulsun", - "Generates a possible headline for a text" : "Bir metin için olası bir başlık oluşturur", + "Generates a possible headline for a text." : "Bir metin için olası bir başlık oluşturur.", "Summarize" : "Özetlensin", "Summarizes text by reducing its length without losing key information." : "Temel içeriği kaybetmeden uzunluğunu kısaltarak metni özetler.", "Extract topics" : "Başlıklar ayıklansın", diff --git a/lib/l10n/vi.js b/lib/l10n/vi.js index a4c189cbf31..7ea1f68dca5 100644 --- a/lib/l10n/vi.js +++ b/lib/l10n/vi.js @@ -3,6 +3,7 @@ OC.L10N.register( { "Cannot write into \"config\" directory!" : "Không thể ghi vào thư mục \"config\"!", "See %s" : "Xem %s", + "The page could not be found on the server." : "Không thể tìm thấy trang trên máy chủ.", "Email verification" : "Xác thực email", "Click the following button to confirm your email." : "Nhấn nút sau để xác nhận email của bạn.", "Click the following link to confirm your email." : "Nhấn liên kết sau để xác nhận email của bạn.", diff --git a/lib/l10n/vi.json b/lib/l10n/vi.json index 3bc1a78d1db..31603bf9c63 100644 --- a/lib/l10n/vi.json +++ b/lib/l10n/vi.json @@ -1,6 +1,7 @@ { "translations": { "Cannot write into \"config\" directory!" : "Không thể ghi vào thư mục \"config\"!", "See %s" : "Xem %s", + "The page could not be found on the server." : "Không thể tìm thấy trang trên máy chủ.", "Email verification" : "Xác thực email", "Click the following button to confirm your email." : "Nhấn nút sau để xác nhận email của bạn.", "Click the following link to confirm your email." : "Nhấn liên kết sau để xác nhận email của bạn.", diff --git a/lib/l10n/zh_HK.js b/lib/l10n/zh_HK.js index f03c100bc19..582fce158f4 100644 --- a/lib/l10n/zh_HK.js +++ b/lib/l10n/zh_HK.js @@ -264,9 +264,9 @@ OC.L10N.register( "Storage is temporarily not available" : "儲存空間暫時無法使用", "Storage connection timeout. %s" : "儲存空間連線逾時。%s", "Free prompt" : "免費提示", - "Runs an arbitrary prompt through the built-in language model." : "通過內置語言模型運行任意提示。", + "Runs an arbitrary prompt through the language model." : "通過語言模型運行任意提示。", "Generate headline" : "産生標題", - "Generates a possible headline for a text" : "為文字生成可能的標題", + "Generates a possible headline for a text." : "為文字生成可能的標題。", "Summarize" : "總結", "Summarizes text by reducing its length without losing key information." : "通過減少文字長度來總結而不丟失關鍵資訊。", "Extract topics" : "解壓縮主題", diff --git a/lib/l10n/zh_HK.json b/lib/l10n/zh_HK.json index dc322a17bda..e003a2166ee 100644 --- a/lib/l10n/zh_HK.json +++ b/lib/l10n/zh_HK.json @@ -262,9 +262,9 @@ "Storage is temporarily not available" : "儲存空間暫時無法使用", "Storage connection timeout. %s" : "儲存空間連線逾時。%s", "Free prompt" : "免費提示", - "Runs an arbitrary prompt through the built-in language model." : "通過內置語言模型運行任意提示。", + "Runs an arbitrary prompt through the language model." : "通過語言模型運行任意提示。", "Generate headline" : "産生標題", - "Generates a possible headline for a text" : "為文字生成可能的標題", + "Generates a possible headline for a text." : "為文字生成可能的標題。", "Summarize" : "總結", "Summarizes text by reducing its length without losing key information." : "通過減少文字長度來總結而不丟失關鍵資訊。", "Extract topics" : "解壓縮主題", diff --git a/lib/l10n/zh_TW.js b/lib/l10n/zh_TW.js index 1f88228d2e7..760072084d6 100644 --- a/lib/l10n/zh_TW.js +++ b/lib/l10n/zh_TW.js @@ -264,9 +264,9 @@ OC.L10N.register( "Storage is temporarily not available" : "儲存空間暫時無法使用", "Storage connection timeout. %s" : "儲存空間連線逾時。%s", "Free prompt" : "免費提示詞", - "Runs an arbitrary prompt through the built-in language model." : "透過內建語言模型執行任意提示詞。", + "Runs an arbitrary prompt through the language model." : "透過語言模型執行任意提示詞。", "Generate headline" : "產生標題", - "Generates a possible headline for a text" : "為文字產生可能的標題", + "Generates a possible headline for a text." : "為文字產生可能的標題。", "Summarize" : "總結", "Summarizes text by reducing its length without losing key information." : "透過減少文字長度來總結而不遺失關鍵資訊。", "Extract topics" : "擷取主題", diff --git a/lib/l10n/zh_TW.json b/lib/l10n/zh_TW.json index 2e6be0f2226..f4be771fbbb 100644 --- a/lib/l10n/zh_TW.json +++ b/lib/l10n/zh_TW.json @@ -262,9 +262,9 @@ "Storage is temporarily not available" : "儲存空間暫時無法使用", "Storage connection timeout. %s" : "儲存空間連線逾時。%s", "Free prompt" : "免費提示詞", - "Runs an arbitrary prompt through the built-in language model." : "透過內建語言模型執行任意提示詞。", + "Runs an arbitrary prompt through the language model." : "透過語言模型執行任意提示詞。", "Generate headline" : "產生標題", - "Generates a possible headline for a text" : "為文字產生可能的標題", + "Generates a possible headline for a text." : "為文字產生可能的標題。", "Summarize" : "總結", "Summarizes text by reducing its length without losing key information." : "透過減少文字長度來總結而不遺失關鍵資訊。", "Extract topics" : "擷取主題", diff --git a/lib/private/Accounts/AccountManager.php b/lib/private/Accounts/AccountManager.php index 43d18a0d941..95199d8380c 100644 --- a/lib/private/Accounts/AccountManager.php +++ b/lib/private/Accounts/AccountManager.php @@ -41,6 +41,7 @@ use libphonenumber\NumberParseException; use libphonenumber\PhoneNumberFormat; use libphonenumber\PhoneNumberUtil; use OC\Profile\TProfileHelper; +use OCP\Accounts\UserUpdatedEvent; use OCP\Cache\CappedMemoryCache; use OCA\Settings\BackgroundJobs\VerifyUserData; use OCP\Accounts\IAccount; @@ -51,6 +52,7 @@ use OCP\Accounts\PropertyDoesNotExistException; use OCP\BackgroundJob\IJobList; use OCP\DB\QueryBuilder\IQueryBuilder; use OCP\Defaults; +use OCP\EventDispatcher\IEventDispatcher; use OCP\IConfig; use OCP\IDBConnection; use OCP\IL10N; @@ -62,8 +64,6 @@ use OCP\Security\ICrypto; use OCP\Security\VerificationToken\IVerificationToken; use OCP\Util; use Psr\Log\LoggerInterface; -use Symfony\Component\EventDispatcher\EventDispatcherInterface; -use Symfony\Component\EventDispatcher\GenericEvent; use function array_flip; use function iterator_to_array; use function json_decode; @@ -109,7 +109,7 @@ class AccountManager implements IAccountManager { public function __construct( private IDBConnection $connection, private IConfig $config, - private EventDispatcherInterface $eventDispatcher, + private IEventDispatcher $dispatcher, private IJobList $jobList, private LoggerInterface $logger, private IVerificationToken $verificationToken, @@ -255,10 +255,10 @@ class AccountManager implements IAccountManager { } if ($updated) { - $this->eventDispatcher->dispatch( - 'OC\AccountManager::userUpdated', - new GenericEvent($user, $data) - ); + $this->dispatcher->dispatchTyped(new UserUpdatedEvent( + $user, + $data, + )); } return $data; diff --git a/lib/private/Authentication/TwoFactorAuth/Manager.php b/lib/private/Authentication/TwoFactorAuth/Manager.php index 8ae08ca65ae..ff0c33445a2 100644 --- a/lib/private/Authentication/TwoFactorAuth/Manager.php +++ b/lib/private/Authentication/TwoFactorAuth/Manager.php @@ -112,9 +112,6 @@ class Manager { /** * Determine whether the user must provide a second factor challenge - * - * @param IUser $user - * @return boolean */ public function isTwoFactorAuthenticated(IUser $user): bool { if (isset($this->userIsTwoFactorAuthenticated[$user->getUID()])) { @@ -138,18 +135,13 @@ class Manager { /** * Get a 2FA provider by its ID - * - * @param IUser $user - * @param string $challengeProviderId - * @return IProvider|null */ - public function getProvider(IUser $user, string $challengeProviderId) { + public function getProvider(IUser $user, string $challengeProviderId): ?IProvider { $providers = $this->getProviderSet($user)->getProviders(); return $providers[$challengeProviderId] ?? null; } /** - * @param IUser $user * @return IActivatableAtLogin[] * @throws Exception */ diff --git a/lib/private/Collaboration/Resources/Listener.php b/lib/private/Collaboration/Resources/Listener.php index 2263f5d3b1a..4330f3570bc 100644 --- a/lib/private/Collaboration/Resources/Listener.php +++ b/lib/private/Collaboration/Resources/Listener.php @@ -26,27 +26,29 @@ declare(strict_types=1); */ namespace OC\Collaboration\Resources; -use OC\EventDispatcher\SymfonyAdapter; use OCP\Collaboration\Resources\IManager; -use OCP\Collaboration\Resources\LoadAdditionalScriptsEvent; use OCP\EventDispatcher\IEventDispatcher; -use OCP\IGroup; -use OCP\IUser; +use OCP\Group\Events\BeforeGroupDeletedEvent; +use OCP\Group\Events\UserAddedEvent; +use OCP\Group\Events\UserRemovedEvent; use OCP\User\Events\UserDeletedEvent; -use Symfony\Component\EventDispatcher\GenericEvent; class Listener { - public static function register(SymfonyAdapter $symfonyDispatcher, IEventDispatcher $eventDispatcher): void { - $listener = function (GenericEvent $event) { - /** @var IUser $user */ - $user = $event->getArgument('user'); + public static function register(IEventDispatcher $eventDispatcher): void { + $eventDispatcher->addListener(UserAddedEvent::class, function (UserAddedEvent $event) { + $user = $event->getUser(); /** @var IManager $resourceManager */ $resourceManager = \OCP\Server::get(IManager::class); $resourceManager->invalidateAccessCacheForUser($user); - }; - $symfonyDispatcher->addListener(IGroup::class . '::postAddUser', $listener); - $symfonyDispatcher->addListener(IGroup::class . '::postRemoveUser', $listener); + }); + $eventDispatcher->addListener(UserRemovedEvent::class, function (UserRemovedEvent $event) { + $user = $event->getUser(); + /** @var IManager $resourceManager */ + $resourceManager = \OCP\Server::get(IManager::class); + + $resourceManager->invalidateAccessCacheForUser($user); + }); $eventDispatcher->addListener(UserDeletedEvent::class, function (UserDeletedEvent $event) { $user = $event->getUser(); @@ -56,9 +58,8 @@ class Listener { $resourceManager->invalidateAccessCacheForUser($user); }); - $symfonyDispatcher->addListener(IGroup::class . '::preDelete', function (GenericEvent $event) { - /** @var IGroup $group */ - $group = $event->getSubject(); + $eventDispatcher->addListener(BeforeGroupDeletedEvent::class, function (BeforeGroupDeletedEvent $event) { + $group = $event->getGroup(); /** @var IManager $resourceManager */ $resourceManager = \OCP\Server::get(IManager::class); @@ -66,24 +67,5 @@ class Listener { $resourceManager->invalidateAccessCacheForUser($user); } }); - - // Stay backward compatible with the legacy event for now - $fallbackEventRunning = false; - $symfonyDispatcher->addListener('\OCP\Collaboration\Resources::loadAdditionalScripts', function () use ($eventDispatcher, &$fallbackEventRunning) { - if ($fallbackEventRunning) { - return; - } - $fallbackEventRunning = true; - $eventDispatcher->dispatchTyped(new LoadAdditionalScriptsEvent()); - $fallbackEventRunning = false; - }); - $eventDispatcher->addListener(LoadAdditionalScriptsEvent::class, static function () use ($symfonyDispatcher, &$fallbackEventRunning) { - if ($fallbackEventRunning) { - return; - } - $fallbackEventRunning = true; - $symfonyDispatcher->dispatch('\OCP\Collaboration\Resources::loadAdditionalScripts'); - $fallbackEventRunning = false; - }); } } diff --git a/lib/private/EventDispatcher/GenericEventWrapper.php b/lib/private/EventDispatcher/GenericEventWrapper.php deleted file mode 100644 index f0807b57a8b..00000000000 --- a/lib/private/EventDispatcher/GenericEventWrapper.php +++ /dev/null @@ -1,124 +0,0 @@ -<?php - -declare(strict_types=1); - -/** - * @copyright Copyright (c) 2020, Roeland Jago Douma <roeland@famdouma.nl> - * - * @author Christoph Wurst <christoph@winzerhof-wurst.at> - * @author Roeland Jago Douma <roeland@famdouma.nl> - * - * @license GNU AGPL version 3 or any later version - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU Affero General Public License as - * published by the Free Software Foundation, either version 3 of the - * License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Affero General Public License for more details. - * - * You should have received a copy of the GNU Affero General Public License - * along with this program. If not, see <http://www.gnu.org/licenses/>. - * - */ -namespace OC\EventDispatcher; - -use Psr\Log\LoggerInterface; -use Symfony\Component\EventDispatcher\GenericEvent; - -class GenericEventWrapper extends GenericEvent { - private LoggerInterface $logger; - - /** @var GenericEvent */ - private $event; - - /** @var string */ - private $eventName; - - /** @var bool */ - private $deprecationNoticeLogged = false; - - public function __construct(LoggerInterface $logger, string $eventName, ?GenericEvent $event) { - parent::__construct($eventName); - $this->logger = $logger; - $this->event = $event; - $this->eventName = $eventName; - } - - private function log() { - if ($this->deprecationNoticeLogged) { - return; - } - - $class = ($this->event !== null && is_object($this->event)) ? get_class($this->event) : 'null'; - $this->logger->debug( - 'Deprecated event type for {name}: {class} is used', - [ 'name' => $this->eventName, 'class' => $class] - ); - $this->deprecationNoticeLogged = true; - } - - public function isPropagationStopped(): bool { - $this->log(); - return $this->event->isPropagationStopped(); - } - - public function stopPropagation(): void { - $this->log(); - $this->event->stopPropagation(); - } - - public function getSubject() { - $this->log(); - return $this->event->getSubject(); - } - - public function getArgument($key) { - $this->log(); - return $this->event->getArgument($key); - } - - public function setArgument($key, $value) { - $this->log(); - return $this->event->setArgument($key, $value); - } - - public function getArguments() { - return $this->event->getArguments(); - } - - public function setArguments(array $args = []) { - return $this->event->setArguments($args); - } - - public function hasArgument($key) { - return $this->event->hasArgument($key); - } - - /** - * @return mixed - */ - #[\ReturnTypeWillChange] - public function offsetGet($key) { - return $this->event->offsetGet($key); - } - - public function offsetSet($key, $value): void { - $this->event->offsetSet($key, $value); - } - - public function offsetUnset($key): void { - $this->event->offsetUnset($key); - } - - public function offsetExists($key): bool { - return $this->event->offsetExists($key); - } - - public function getIterator() { - return$this->event->getIterator(); - } -} diff --git a/lib/private/EventDispatcher/SymfonyAdapter.php b/lib/private/EventDispatcher/SymfonyAdapter.php deleted file mode 100644 index 139f444ce44..00000000000 --- a/lib/private/EventDispatcher/SymfonyAdapter.php +++ /dev/null @@ -1,208 +0,0 @@ -<?php - -declare(strict_types=1); - -/** - * @copyright 2019 Christoph Wurst <christoph@winzerhof-wurst.at> - * - * @author Arthur Schiwon <blizzz@arthur-schiwon.de> - * @author Christoph Wurst <christoph@winzerhof-wurst.at> - * @author Roeland Jago Douma <roeland@famdouma.nl> - * - * @license GNU AGPL version 3 or any later version - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU Affero General Public License as - * published by the Free Software Foundation, either version 3 of the - * License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Affero General Public License for more details. - * - * You should have received a copy of the GNU Affero General Public License - * along with this program. If not, see <http://www.gnu.org/licenses/>. - * - */ -namespace OC\EventDispatcher; - -use OCP\EventDispatcher\Event; -use Psr\Log\LoggerInterface; -use Symfony\Component\EventDispatcher\EventDispatcherInterface; -use Symfony\Component\EventDispatcher\EventSubscriberInterface; -use Symfony\Component\EventDispatcher\GenericEvent; -use function is_callable; -use function is_object; -use function is_string; - -/** - * @deprecated 20.0.0 use \OCP\EventDispatcher\IEventDispatcher - */ -class SymfonyAdapter implements EventDispatcherInterface { - /** @var EventDispatcher */ - private $eventDispatcher; - private LoggerInterface $logger; - - /** - * @deprecated 20.0.0 - */ - public function __construct(EventDispatcher $eventDispatcher, LoggerInterface $logger) { - $this->eventDispatcher = $eventDispatcher; - $this->logger = $logger; - } - - private static function detectEventAndName($a, $b) { - if (is_object($a) && (is_string($b) || $b === null)) { - // a is the event, the other one is the optional name - return [$a, $b]; - } - if (is_object($b) && (is_string($a) || $a === null)) { - // b is the event, the other one is the optional name - return [$b, $a]; - } - if (is_string($a) && $b === null) { - // a is a payload-less event - return [null, $a]; - } - if (is_string($b) && $a === null) { - // b is a payload-less event - return [null, $b]; - } - - // Anything else we can't detect - return [$a, $b]; - } - - /** - * Dispatches an event to all registered listeners. - * - * @param string $eventName The name of the event to dispatch. The name of - * the event is the name of the method that is - * invoked on listeners. - * @param Event|null $event The event to pass to the event handlers/listeners - * If not supplied, an empty Event instance is created - * - * @return object the emitted event - * @deprecated 20.0.0 - */ - public function dispatch($eventName, $event = null): object { - [$event, $eventName] = self::detectEventAndName($event, $eventName); - - // type hinting is not possible, due to usage of GenericEvent - if ($event instanceof Event && $eventName === null) { - $this->eventDispatcher->dispatchTyped($event); - return $event; - } - if ($event instanceof Event) { - $this->eventDispatcher->dispatch($eventName, $event); - return $event; - } - - if ($event instanceof GenericEvent && get_class($event) === GenericEvent::class) { - $newEvent = new GenericEventWrapper($this->logger, $eventName, $event); - } else { - $newEvent = $event; - - // Legacy event - $this->logger->debug( - 'Deprecated event type for {name}: {class}', - ['name' => $eventName, 'class' => is_object($event) ? get_class($event) : 'null'] - ); - } - - // Event with no payload (object) need special handling - if ($newEvent === null) { - $newEvent = new Event(); - } - - // Flip the argument order for Symfony to prevent a trigger_error - return $this->eventDispatcher->getSymfonyDispatcher()->dispatch($newEvent, $eventName); - } - - /** - * Adds an event listener that listens on the specified events. - * - * @param string $eventName The event to listen on - * @param callable $listener The listener - * @param int $priority The higher this value, the earlier an event - * listener will be triggered in the chain (defaults to 0) - * @deprecated 20.0.0 - */ - public function addListener($eventName, $listener, $priority = 0) { - if (is_callable($listener)) { - $this->eventDispatcher->addListener($eventName, $listener, $priority); - } else { - // Legacy listener - $this->eventDispatcher->getSymfonyDispatcher()->addListener($eventName, $listener, $priority); - } - } - - /** - * Adds an event subscriber. - * - * The subscriber is asked for all the events it is - * interested in and added as a listener for these events. - * @deprecated 20.0.0 - */ - public function addSubscriber(EventSubscriberInterface $subscriber) { - $this->eventDispatcher->getSymfonyDispatcher()->addSubscriber($subscriber); - } - - /** - * Removes an event listener from the specified events. - * - * @param string $eventName The event to remove a listener from - * @param callable $listener The listener to remove - * @deprecated 20.0.0 - */ - public function removeListener($eventName, $listener) { - $this->eventDispatcher->getSymfonyDispatcher()->removeListener($eventName, $listener); - } - - /** - * @deprecated 20.0.0 - */ - public function removeSubscriber(EventSubscriberInterface $subscriber) { - $this->eventDispatcher->getSymfonyDispatcher()->removeSubscriber($subscriber); - } - - /** - * Gets the listeners of a specific event or all listeners sorted by descending priority. - * - * @param string|null $eventName The name of the event - * - * @return array The event listeners for the specified event, or all event listeners by event name - * @deprecated 20.0.0 - */ - public function getListeners($eventName = null) { - return $this->eventDispatcher->getSymfonyDispatcher()->getListeners($eventName); - } - - /** - * Gets the listener priority for a specific event. - * - * Returns null if the event or the listener does not exist. - * - * @param string $eventName The name of the event - * @param callable $listener The listener - * - * @return int|null The event listener priority - * @deprecated 20.0.0 - */ - public function getListenerPriority($eventName, $listener) { - return $this->eventDispatcher->getSymfonyDispatcher()->getListenerPriority($eventName, $listener); - } - - /** - * Checks whether an event has any registered listeners. - * - * @param string|null $eventName The name of the event - * - * @return bool true if the specified event has any listeners, false otherwise - * @deprecated 20.0.0 - */ - public function hasListeners($eventName = null) { - return $this->eventDispatcher->getSymfonyDispatcher()->hasListeners($eventName); - } -} diff --git a/lib/private/Files/Cache/Cache.php b/lib/private/Files/Cache/Cache.php index 4770e168bfb..287966e4a28 100644 --- a/lib/private/Files/Cache/Cache.php +++ b/lib/private/Files/Cache/Cache.php @@ -668,7 +668,7 @@ class Cache implements ICache { $targetPath = $this->normalize($targetPath); $sourceData = $sourceCache->get($sourcePath); - if ($sourceData === false) { + if (!$sourceData) { throw new \Exception('Invalid source storage path: ' . $sourcePath); } diff --git a/lib/private/Files/Node/Node.php b/lib/private/Files/Node/Node.php index 4ba2c472c67..61ae762638f 100644 --- a/lib/private/Files/Node/Node.php +++ b/lib/private/Files/Node/Node.php @@ -32,6 +32,8 @@ namespace OC\Files\Node; use OC\Files\Filesystem; use OC\Files\Mount\MoveableMount; use OC\Files\Utils\PathHelper; +use OCP\EventDispatcher\GenericEvent; +use OCP\EventDispatcher\IEventDispatcher; use OCP\Files\FileInfo; use OCP\Files\InvalidPathException; use OCP\Files\IRootFolder; @@ -40,7 +42,6 @@ use OCP\Files\NotFoundException; use OCP\Files\NotPermittedException; use OCP\Lock\LockedException; use OCP\PreConditionNotMetException; -use Symfony\Component\EventDispatcher\GenericEvent; // FIXME: this class really should be abstract class Node implements INode { @@ -127,7 +128,8 @@ class Node implements INode { */ protected function sendHooks($hooks, array $args = null) { $args = !empty($args) ? $args : [$this]; - $dispatcher = \OC::$server->getEventDispatcher(); + /** @var IEventDispatcher $dispatcher */ + $dispatcher = \OC::$server->get(IEventDispatcher::class); foreach ($hooks as $hook) { if (method_exists($this->root, 'emit')) { $this->root->emit('\OC\Files', $hook, $args); diff --git a/lib/private/Preview/Imaginary.php b/lib/private/Preview/Imaginary.php index 74f04e09250..da4864b1a22 100644 --- a/lib/private/Preview/Imaginary.php +++ b/lib/private/Preview/Imaginary.php @@ -148,14 +148,14 @@ class Imaginary extends ProviderV2 { 'connect_timeout' => 3, ]); } catch (\Exception $e) { - $this->logger->error('Imaginary preview generation failed: ' . $e->getMessage(), [ + $this->logger->info('Imaginary preview generation failed: ' . $e->getMessage(), [ 'exception' => $e, ]); return null; } if ($response->getStatusCode() !== 200) { - $this->logger->error('Imaginary preview generation failed: ' . json_decode($response->getBody())['message']); + $this->logger->info('Imaginary preview generation failed: ' . json_decode($response->getBody())['message']); return null; } diff --git a/lib/private/Server.php b/lib/private/Server.php index 8640fa3e38c..e9966e83cae 100644 --- a/lib/private/Server.php +++ b/lib/private/Server.php @@ -82,7 +82,6 @@ use OC\DB\Connection; use OC\DB\ConnectionAdapter; use OC\Diagnostics\EventLogger; use OC\Diagnostics\QueryLogger; -use OC\EventDispatcher\SymfonyAdapter; use OC\Federation\CloudFederationFactory; use OC\Federation\CloudFederationProviderManager; use OC\Federation\CloudIdManager; @@ -257,7 +256,6 @@ use OCP\User\Events\UserLoggedOutEvent; use Psr\Container\ContainerExceptionInterface; use Psr\Container\ContainerInterface; use Psr\Log\LoggerInterface; -use Symfony\Component\EventDispatcher\EventDispatcherInterface; use OCA\Files_External\Service\UserStoragesService; use OCA\Files_External\Service\UserGlobalStoragesService; use OCA\Files_External\Service\GlobalStoragesService; @@ -1181,9 +1179,6 @@ class Server extends ServerContainer implements IServerContainer { ); }); $this->registerAlias(\OCP\EventDispatcher\IEventDispatcher::class, \OC\EventDispatcher\EventDispatcher::class); - /** @deprecated 19.0.0 */ - $this->registerDeprecatedAlias('EventDispatcher', \OC\EventDispatcher\SymfonyAdapter::class); - $this->registerAlias(EventDispatcherInterface::class, \OC\EventDispatcher\SymfonyAdapter::class); $this->registerService('CryptoWrapper', function (ContainerInterface $c) { // FIXME: Instantiated here due to cyclic dependency @@ -1237,7 +1232,6 @@ class Server extends ServerContainer implements IServerContainer { $factory, $c->get(IUserManager::class), $c->get(IRootFolder::class), - $c->get(SymfonyAdapter::class), $c->get(IMailer::class), $c->get(IURLGenerator::class), $c->get('ThemingDefaults'), @@ -2046,17 +2040,6 @@ class Server extends ServerContainer implements IServerContainer { } /** - * Get the EventDispatcher - * - * @return EventDispatcherInterface - * @since 8.2.0 - * @deprecated 18.0.0 use \OCP\EventDispatcher\IEventDispatcher - */ - public function getEventDispatcher() { - return $this->get(\OC\EventDispatcher\SymfonyAdapter::class); - } - - /** * Get the Notification Manager * * @return \OCP\Notification\IManager diff --git a/lib/private/Share20/LegacyHooks.php b/lib/private/Share20/LegacyHooks.php index 688b2273384..24d07167fbd 100644 --- a/lib/private/Share20/LegacyHooks.php +++ b/lib/private/Share20/LegacyHooks.php @@ -29,8 +29,12 @@ namespace OC\Share20; use OCP\EventDispatcher\IEventDispatcher; use OCP\Files\File; use OCP\Share; +use OCP\Share\Events\BeforeShareCreatedEvent; +use OCP\Share\Events\BeforeShareDeletedEvent; +use OCP\Share\Events\ShareCreatedEvent; +use OCP\Share\Events\ShareDeletedEvent; +use OCP\Share\Events\ShareDeletedFromSelfEvent; use OCP\Share\IShare; -use Symfony\Component\EventDispatcher\GenericEvent; class LegacyHooks { /** @var IEventDispatcher */ @@ -39,62 +43,41 @@ class LegacyHooks { public function __construct(IEventDispatcher $eventDispatcher) { $this->eventDispatcher = $eventDispatcher; - $this->eventDispatcher->addListener('OCP\Share::preUnshare', function ($event) { - if ($event instanceof GenericEvent) { - $this->preUnshare($event); - } + $this->eventDispatcher->addListener(BeforeShareDeletedEvent::class, function (BeforeShareDeletedEvent $event) { + $this->preUnshare($event); }); - $this->eventDispatcher->addListener('OCP\Share::postUnshare', function ($event) { - if ($event instanceof GenericEvent) { - $this->postUnshare($event); - } + $this->eventDispatcher->addListener(ShareDeletedEvent::class, function (ShareDeletedEvent $event) { + $this->postUnshare($event); }); - $this->eventDispatcher->addListener('OCP\Share::postUnshareFromSelf', function ($event) { - if ($event instanceof GenericEvent) { - $this->postUnshareFromSelf($event); - } + $this->eventDispatcher->addListener(ShareDeletedFromSelfEvent::class, function (ShareDeletedFromSelfEvent $event) { + $this->postUnshareFromSelf($event); }); - $this->eventDispatcher->addListener('OCP\Share::preShare', function ($event) { - if ($event instanceof GenericEvent) { - $this->preShare($event); - } + $this->eventDispatcher->addListener(BeforeShareCreatedEvent::class, function (BeforeShareCreatedEvent $event) { + $this->preShare($event); }); - $this->eventDispatcher->addListener('OCP\Share::postShare', function ($event) { - if ($event instanceof GenericEvent) { - $this->postShare($event); - } + $this->eventDispatcher->addListener(ShareCreatedEvent::class, function (ShareCreatedEvent $event) { + $this->postShare($event); }); } - public function preUnshare(GenericEvent $e) { - /** @var IShare $share */ - $share = $e->getSubject(); + public function preUnshare(BeforeShareDeletedEvent $e) { + $share = $e->getShare(); $formatted = $this->formatHookParams($share); \OC_Hook::emit(Share::class, 'pre_unshare', $formatted); } - public function postUnshare(GenericEvent $e) { - /** @var IShare $share */ - $share = $e->getSubject(); + public function postUnshare(ShareDeletedEvent $e) { + $share = $e->getShare(); $formatted = $this->formatHookParams($share); - - /** @var IShare[] $deletedShares */ - $deletedShares = $e->getArgument('deletedShares'); - - $formattedDeletedShares = array_map(function ($share) { - return $this->formatHookParams($share); - }, $deletedShares); - - $formatted['deletedShares'] = $formattedDeletedShares; + $formatted['deletedShares'] = [$formatted]; \OC_Hook::emit(Share::class, 'post_unshare', $formatted); } - public function postUnshareFromSelf(GenericEvent $e) { - /** @var IShare $share */ - $share = $e->getSubject(); + public function postUnshareFromSelf(ShareDeletedFromSelfEvent $e) { + $share = $e->getShare(); $formatted = $this->formatHookParams($share); $formatted['itemTarget'] = $formatted['fileTarget']; @@ -127,9 +110,8 @@ class LegacyHooks { return $hookParams; } - public function preShare(GenericEvent $e) { - /** @var IShare $share */ - $share = $e->getSubject(); + public function preShare(BeforeShareCreatedEvent $e) { + $share = $e->getShare(); // Pre share hook $run = true; @@ -151,16 +133,15 @@ class LegacyHooks { \OC_Hook::emit(Share::class, 'pre_shared', $preHookData); if ($run === false) { - $e->setArgument('error', $error); + $e->setError($error); $e->stopPropagation(); } return $e; } - public function postShare(GenericEvent $e) { - /** @var IShare $share */ - $share = $e->getSubject(); + public function postShare(ShareCreatedEvent $e) { + $share = $e->getShare(); $postHookData = [ 'itemType' => $share->getNode() instanceof File ? 'file' : 'folder', diff --git a/lib/private/Share20/Manager.php b/lib/private/Share20/Manager.php index 3f5dbd7cd28..9360046bc24 100644 --- a/lib/private/Share20/Manager.php +++ b/lib/private/Share20/Manager.php @@ -67,6 +67,11 @@ use OCP\Security\Events\ValidatePasswordPolicyEvent; use OCP\Security\IHasher; use OCP\Security\ISecureRandom; use OCP\Share; +use OCP\Share\Events\BeforeShareDeletedEvent; +use OCP\Share\Events\ShareAcceptedEvent; +use OCP\Share\Events\ShareCreatedEvent; +use OCP\Share\Events\ShareDeletedEvent; +use OCP\Share\Events\ShareDeletedFromSelfEvent; use OCP\Share\Exceptions\AlreadySharedException; use OCP\Share\Exceptions\GenericShareException; use OCP\Share\Exceptions\ShareNotFound; @@ -75,8 +80,6 @@ use OCP\Share\IProviderFactory; use OCP\Share\IShare; use OCP\Share\IShareProvider; use Psr\Log\LoggerInterface; -use Symfony\Component\EventDispatcher\EventDispatcherInterface; -use Symfony\Component\EventDispatcher\GenericEvent; /** * This class is the communication hub for all sharing related operations. @@ -105,8 +108,6 @@ class Manager implements IManager { private $rootFolder; /** @var CappedMemoryCache */ private $sharingDisabledForUsersCache; - /** @var EventDispatcherInterface */ - private $legacyDispatcher; /** @var LegacyHooks */ private $legacyHooks; /** @var IMailer */ @@ -134,7 +135,6 @@ class Manager implements IManager { IProviderFactory $factory, IUserManager $userManager, IRootFolder $rootFolder, - EventDispatcherInterface $legacyDispatcher, IMailer $mailer, IURLGenerator $urlGenerator, \OC_Defaults $defaults, @@ -153,7 +153,6 @@ class Manager implements IManager { $this->factory = $factory; $this->userManager = $userManager; $this->rootFolder = $rootFolder; - $this->legacyDispatcher = $legacyDispatcher; $this->sharingDisabledForUsersCache = new CappedMemoryCache(); // The constructor of LegacyHooks registers the listeners of share events // do not remove if those are not properly migrated @@ -806,10 +805,10 @@ class Manager implements IManager { $share->setTarget($target); // Pre share event - $event = new GenericEvent($share); - $this->legacyDispatcher->dispatch('OCP\Share::preShare', $event); - if ($event->isPropagationStopped() && $event->hasArgument('error')) { - throw new \Exception($event->getArgument('error')); + $event = new Share\Events\BeforeShareCreatedEvent($share); + $this->dispatcher->dispatchTyped($event); + if ($event->isPropagationStopped() && $event->getError()) { + throw new \Exception($event->getError()); } $oldShare = $share; @@ -833,10 +832,7 @@ class Manager implements IManager { } // Post share event - $event = new GenericEvent($share); - $this->legacyDispatcher->dispatch('OCP\Share::postShare', $event); - - $this->dispatcher->dispatchTyped(new Share\Events\ShareCreatedEvent($share)); + $this->dispatcher->dispatchTyped(new ShareCreatedEvent($share)); if ($this->config->getSystemValueBool('sharing.enable_share_mail', true) && $share->getShareType() === IShare::TYPE_USER) { @@ -1122,8 +1118,9 @@ class Manager implements IManager { throw new \InvalidArgumentException('Share provider does not support accepting'); } $provider->acceptShare($share, $recipientId); - $event = new GenericEvent($share); - $this->legacyDispatcher->dispatch('OCP\Share::postAcceptShare', $event); + + $event = new ShareAcceptedEvent($share); + $this->dispatcher->dispatchTyped($event); return $share; } @@ -1206,11 +1203,13 @@ class Manager implements IManager { $provider = $this->factory->getProviderForType($share->getShareType()); foreach ($provider->getChildren($share) as $child) { + $this->dispatcher->dispatchTyped(new BeforeShareDeletedEvent($child)); + $deletedChildren = $this->deleteChildren($child); $deletedShares = array_merge($deletedShares, $deletedChildren); $provider->delete($child); - $this->dispatcher->dispatchTyped(new Share\Events\ShareDeletedEvent($child)); + $this->dispatcher->dispatchTyped(new ShareDeletedEvent($child)); $deletedShares[] = $child; } @@ -1231,24 +1230,16 @@ class Manager implements IManager { throw new \InvalidArgumentException('Share does not have a full id'); } - $event = new GenericEvent($share); - $this->legacyDispatcher->dispatch('OCP\Share::preUnshare', $event); + $this->dispatcher->dispatchTyped(new BeforeShareDeletedEvent($share)); // Get all children and delete them as well - $deletedShares = $this->deleteChildren($share); + $this->deleteChildren($share); // Do the actual delete $provider = $this->factory->getProviderForType($share->getShareType()); $provider->delete($share); - $this->dispatcher->dispatchTyped(new Share\Events\ShareDeletedEvent($share)); - - // All the deleted shares caused by this delete - $deletedShares[] = $share; - - // Emit post hook - $event->setArgument('deletedShares', $deletedShares); - $this->legacyDispatcher->dispatch('OCP\Share::postUnshare', $event); + $this->dispatcher->dispatchTyped(new ShareDeletedEvent($share)); } @@ -1266,8 +1257,8 @@ class Manager implements IManager { $provider = $this->factory->getProvider($providerId); $provider->deleteFromSelf($share, $recipientId); - $event = new GenericEvent($share); - $this->legacyDispatcher->dispatch('OCP\Share::postUnshareFromSelf', $event); + $event = new ShareDeletedFromSelfEvent($share); + $this->dispatcher->dispatchTyped($event); } public function restoreShare(IShare $share, string $recipientId): IShare { diff --git a/lib/private/SpeechToText/SpeechToTextManager.php b/lib/private/SpeechToText/SpeechToTextManager.php index 757fc02485e..bdd04ad3651 100644 --- a/lib/private/SpeechToText/SpeechToTextManager.php +++ b/lib/private/SpeechToText/SpeechToTextManager.php @@ -34,6 +34,7 @@ use OCP\BackgroundJob\IJobList; use OCP\Files\File; use OCP\Files\InvalidPathException; use OCP\Files\NotFoundException; +use OCP\IConfig; use OCP\IServerContainer; use OCP\PreConditionNotMetException; use OCP\SpeechToText\ISpeechToTextManager; @@ -53,6 +54,7 @@ class SpeechToTextManager implements ISpeechToTextManager { private Coordinator $coordinator, private LoggerInterface $logger, private IJobList $jobList, + private IConfig $config, ) { } @@ -111,7 +113,18 @@ class SpeechToTextManager implements ISpeechToTextManager { throw new PreConditionNotMetException('No SpeechToText providers have been registered'); } - foreach ($this->getProviders() as $provider) { + $providers = $this->getProviders(); + + $json = $this->config->getAppValue('core', 'ai.stt_provider', ''); + if ($json !== '') { + $className = json_decode($json, true); + $provider = current(array_filter($providers, fn ($provider) => $provider::class === $className)); + if ($provider !== false) { + $providers = [$provider]; + } + } + + foreach ($providers as $provider) { try { return $provider->transcribeFile($file); } catch (\Throwable $e) { diff --git a/lib/private/TextProcessing/Db/Task.php b/lib/private/TextProcessing/Db/Task.php index 8c2ddb74f1f..9c6f16d11ae 100644 --- a/lib/private/TextProcessing/Db/Task.php +++ b/lib/private/TextProcessing/Db/Task.php @@ -39,11 +39,11 @@ use OCP\TextProcessing\Task as OCPTask; * @method string getOutput() * @method setStatus(int $type) * @method int getStatus() - * @method setUserId(string $type) - * @method string getuserId() + * @method setUserId(?string $userId) + * @method string|null getUserId() * @method setAppId(string $type) * @method string getAppId() - * @method setIdentifier(string $type) + * @method setIdentifier(string $identifier) * @method string getIdentifier() */ class Task extends Entity { diff --git a/lib/private/TextProcessing/Db/TaskMapper.php b/lib/private/TextProcessing/Db/TaskMapper.php index 508f3fdf3b8..62dabea544f 100644 --- a/lib/private/TextProcessing/Db/TaskMapper.php +++ b/lib/private/TextProcessing/Db/TaskMapper.php @@ -41,7 +41,7 @@ class TaskMapper extends QBMapper { IDBConnection $db, private ITimeFactory $timeFactory, ) { - parent::__construct($db, 'llm_tasks', Task::class); + parent::__construct($db, 'textprocessing_tasks', Task::class); } /** @@ -60,6 +60,46 @@ class TaskMapper extends QBMapper { } /** + * @param int $id + * @param string|null $userId + * @return Task + * @throws DoesNotExistException + * @throws Exception + * @throws MultipleObjectsReturnedException + */ + public function findByIdAndUser(int $id, ?string $userId): Task { + $qb = $this->db->getQueryBuilder(); + $qb->select(Task::$columns) + ->from($this->tableName) + ->where($qb->expr()->eq('id', $qb->createPositionalParameter($id))); + if ($userId === null) { + $qb->andWhere($qb->expr()->isNull('user_id')); + } else { + $qb->andWhere($qb->expr()->eq('user_id', $qb->createPositionalParameter($userId))); + } + return $this->findEntity($qb); + } + + /** + * @param string $userId + * @param string $appId + * @param string|null $identifier + * @return array + * @throws Exception + */ + public function findUserTasksByApp(string $userId, string $appId, ?string $identifier = null): array { + $qb = $this->db->getQueryBuilder(); + $qb->select(Task::$columns) + ->from($this->tableName) + ->where($qb->expr()->eq('user_id', $qb->createPositionalParameter($userId))) + ->andWhere($qb->expr()->eq('app_id', $qb->createPositionalParameter($appId))); + if ($identifier !== null) { + $qb->andWhere($qb->expr()->eq('identifier', $qb->createPositionalParameter($identifier))); + } + return $this->findEntities($qb); + } + + /** * @param int $timeout * @return int the number of deleted tasks * @throws Exception diff --git a/lib/private/TextProcessing/Manager.php b/lib/private/TextProcessing/Manager.php index f52482bbb32..b9cb06c298e 100644 --- a/lib/private/TextProcessing/Manager.php +++ b/lib/private/TextProcessing/Manager.php @@ -27,6 +27,8 @@ namespace OC\TextProcessing; use OC\AppFramework\Bootstrap\Coordinator; use OC\TextProcessing\Db\Task as DbTask; +use OCP\IConfig; +use OCP\TextProcessing\Task; use OCP\TextProcessing\Task as OCPTask; use OC\TextProcessing\Db\TaskMapper; use OCP\AppFramework\Db\DoesNotExistException; @@ -52,6 +54,7 @@ class Manager implements IManager { private LoggerInterface $logger, private IJobList $jobList, private TaskMapper $taskMapper, + private IConfig $config, ) { } @@ -111,7 +114,21 @@ class Manager implements IManager { if (!$this->canHandleTask($task)) { throw new PreConditionNotMetException('No text processing provider is installed that can handle this task'); } - foreach ($this->getProviders() as $provider) { + $providers = $this->getProviders(); + $json = $this->config->getAppValue('core', 'ai.textprocessing_provider_preferences', ''); + if ($json !== '') { + $preferences = json_decode($json, true); + if (isset($preferences[$task->getType()])) { + // If a preference for this task type is set, move the preferred provider to the start + $provider = current(array_filter($providers, fn ($provider) => $provider::class === $preferences[$task->getType()])); + if ($provider !== false) { + $providers = array_filter($providers, fn ($p) => $p !== $provider); + array_unshift($providers, $provider); + } + } + } + + foreach ($providers as $provider) { if (!$task->canUseProvider($provider)) { continue; } @@ -162,6 +179,19 @@ class Manager implements IManager { } /** + * @inheritDoc + */ + public function deleteTask(Task $task): void { + $taskEntity = DbTask::fromPublicTask($task); + $this->taskMapper->delete($taskEntity); + $this->jobList->remove(TaskBackgroundJob::class, [ + 'taskId' => $task->getId() + ]); + } + + /** + * Get a task from its id + * * @param int $id The id of the task * @return OCPTask * @throws RuntimeException If the query failed @@ -176,7 +206,51 @@ class Manager implements IManager { } catch (MultipleObjectsReturnedException $e) { throw new RuntimeException('Could not uniquely identify task with given id', 0, $e); } catch (Exception $e) { - throw new RuntimeException('Failure while trying to find task by id: '.$e->getMessage(), 0, $e); + throw new RuntimeException('Failure while trying to find task by id: ' . $e->getMessage(), 0, $e); + } + } + + /** + * Get a task from its user id and task id + * If userId is null, this can only get a task that was scheduled anonymously + * + * @param int $id The id of the task + * @param string|null $userId The user id that scheduled the task + * @return OCPTask + * @throws RuntimeException If the query failed + * @throws NotFoundException If the task could not be found + */ + public function getUserTask(int $id, ?string $userId): OCPTask { + try { + $taskEntity = $this->taskMapper->findByIdAndUser($id, $userId); + return $taskEntity->toPublicTask(); + } catch (DoesNotExistException $e) { + throw new NotFoundException('Could not find task with the provided id and user id'); + } catch (MultipleObjectsReturnedException $e) { + throw new RuntimeException('Could not uniquely identify task with given id and user id', 0, $e); + } catch (Exception $e) { + throw new RuntimeException('Failure while trying to find task by id and user id: ' . $e->getMessage(), 0, $e); + } + } + + /** + * Get a list of tasks scheduled by a specific user for a specific app + * and optionally with a specific identifier. + * This cannot be used to get anonymously scheduled tasks + * + * @param string $userId + * @param string $appId + * @param string|null $identifier + * @return array + */ + public function getUserTasksByApp(string $userId, string $appId, ?string $identifier = null): array { + try { + $taskEntities = $this->taskMapper->findUserTasksByApp($userId, $appId, $identifier); + return array_map(static function (DbTask $taskEntity) { + return $taskEntity->toPublicTask(); + }, $taskEntities); + } catch (Exception $e) { + throw new RuntimeException('Failure while trying to find tasks by appId and identifier: ' . $e->getMessage(), 0, $e); } } } diff --git a/lib/private/Translation/TranslationManager.php b/lib/private/Translation/TranslationManager.php index 8456c41cdfc..48a0e2cdebd 100644 --- a/lib/private/Translation/TranslationManager.php +++ b/lib/private/Translation/TranslationManager.php @@ -28,6 +28,7 @@ namespace OC\Translation; use InvalidArgumentException; use OC\AppFramework\Bootstrap\Coordinator; +use OCP\IConfig; use OCP\IServerContainer; use OCP\PreConditionNotMetException; use OCP\Translation\CouldNotTranslateException; @@ -48,6 +49,7 @@ class TranslationManager implements ITranslationManager { private IServerContainer $serverContainer, private Coordinator $coordinator, private LoggerInterface $logger, + private IConfig $config, ) { } @@ -64,8 +66,25 @@ class TranslationManager implements ITranslationManager { throw new PreConditionNotMetException('No translation providers available'); } + $providers = $this->getProviders(); + $json = $this->config->getAppValue('core', 'ai.translation_provider_preferences', ''); + + if ($json !== '') { + $precedence = json_decode($json, true); + $newProviders = []; + foreach ($precedence as $className) { + $provider = current(array_filter($providers, fn ($provider) => $provider::class === $className)); + if ($provider !== false) { + $newProviders[] = $provider; + } + } + // Add all providers that haven't been added so far + $newProviders += array_udiff($providers, $newProviders, fn ($a, $b) => $a::class > $b::class ? 1 : ($a::class < $b::class ? -1 : 0)); + $providers = $newProviders; + } + if ($fromLanguage === null) { - foreach ($this->getProviders() as $provider) { + foreach ($providers as $provider) { if ($provider instanceof IDetectLanguageProvider) { $fromLanguage = $provider->detectLanguage($text); } @@ -84,11 +103,11 @@ class TranslationManager implements ITranslationManager { return $text; } - foreach ($this->getProviders() as $provider) { + foreach ($providers as $provider) { try { return $provider->translate($fromLanguage, $toLanguage, $text); } catch (RuntimeException $e) { - $this->logger->warning("Failed to translate from {$fromLanguage} to {$toLanguage}", ['exception' => $e]); + $this->logger->warning("Failed to translate from {$fromLanguage} to {$toLanguage} using provider {$provider->getName()}", ['exception' => $e]); } } diff --git a/lib/private/User/Session.php b/lib/private/User/Session.php index 840a3c04373..e7075bce47a 100644 --- a/lib/private/User/Session.php +++ b/lib/private/User/Session.php @@ -51,6 +51,7 @@ use OC_User; use OC_Util; use OCA\DAV\Connector\Sabre\Auth; use OCP\AppFramework\Utility\ITimeFactory; +use OCP\EventDispatcher\GenericEvent; use OCP\EventDispatcher\IEventDispatcher; use OCP\Files\NotPermittedException; use OCP\IConfig; @@ -63,9 +64,9 @@ use OCP\Security\Bruteforce\IThrottler; use OCP\Security\ISecureRandom; use OCP\Session\Exceptions\SessionNotAvailableException; use OCP\User\Events\PostLoginEvent; +use OCP\User\Events\UserFirstTimeLoggedInEvent; use OCP\Util; use Psr\Log\LoggerInterface; -use Symfony\Component\EventDispatcher\GenericEvent; /** * Class Session @@ -561,7 +562,8 @@ class Session implements IUserSession, Emitter { } // trigger any other initialization - \OC::$server->getEventDispatcher()->dispatch(IUser::class . '::firstLogin', new GenericEvent($this->getUser())); + \OC::$server->get(IEventDispatcher::class)->dispatch(IUser::class . '::firstLogin', new GenericEvent($this->getUser())); + \OC::$server->get(IEventDispatcher::class)->dispatchTyped(new UserFirstTimeLoggedInEvent($this->getUser())); } } diff --git a/lib/private/legacy/OC_App.php b/lib/private/legacy/OC_App.php index 9337492e775..ac449a62a4f 100644 --- a/lib/private/legacy/OC_App.php +++ b/lib/private/legacy/OC_App.php @@ -802,7 +802,7 @@ class OC_App { \OC::$server->getConfig()->setAppValue($appId, 'installed_version', $version); \OC::$server->get(IEventDispatcher::class)->dispatchTyped(new AppUpdateEvent($appId)); - \OC::$server->getEventDispatcher()->dispatch(ManagerEvent::EVENT_APP_UPDATE, new ManagerEvent( + \OC::$server->get(IEventDispatcher::class)->dispatch(ManagerEvent::EVENT_APP_UPDATE, new ManagerEvent( ManagerEvent::EVENT_APP_UPDATE, $appId )); diff --git a/lib/public/Accounts/UserUpdatedEvent.php b/lib/public/Accounts/UserUpdatedEvent.php new file mode 100644 index 00000000000..e6c73f1d1c1 --- /dev/null +++ b/lib/public/Accounts/UserUpdatedEvent.php @@ -0,0 +1,58 @@ +<?php + +declare(strict_types=1); + +/** + * @copyright Copyright (c) 2023 Joas Schilling <coding@schilljs.com> + * + * @author Joas Schilling <coding@schilljs.com> + * + * @license GNU AGPL version 3 or any later version + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as + * published by the Free Software Foundation, either version 3 of the + * License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Affero General Public License for more details. + * + * You should have received a copy of the GNU Affero General Public License + * along with this program. If not, see <http://www.gnu.org/licenses/>. + * + */ +namespace OCP\Accounts; + +use OCP\EventDispatcher\Event; +use OCP\IUser; + +/** + * @since 28.0.0 + */ +class UserUpdatedEvent extends Event { + /** + * @since 28.0.0 + */ + public function __construct( + protected IUser $user, + protected array $data, + ) { + parent::__construct(); + } + + /** + * @since 28.0.0 + */ + public function getUser(): IUser { + return $this->user; + } + + /** + * @since 28.0.0 + */ + public function getData(): array { + return $this->data; + } +} diff --git a/lib/public/Files/Events/NodeAddedToFavorite.php b/lib/public/Files/Events/NodeAddedToFavorite.php new file mode 100644 index 00000000000..d3f84582e46 --- /dev/null +++ b/lib/public/Files/Events/NodeAddedToFavorite.php @@ -0,0 +1,66 @@ +<?php + +declare(strict_types=1); + +/** + * @copyright Copyright (c) 2023 Joas Schilling <coding@schilljs.com> + * + * @author Joas Schilling <coding@schilljs.com> + * + * @license GNU AGPL version 3 or any later version + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as + * published by the Free Software Foundation, either version 3 of the + * License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Affero General Public License for more details. + * + * You should have received a copy of the GNU Affero General Public License + * along with this program. If not, see <http://www.gnu.org/licenses/>. + * + */ +namespace OCP\Files\Events; + +use OCP\EventDispatcher\Event; +use OCP\IUser; + +/** + * @since 28.0.0 + */ +class NodeAddedToFavorite extends Event { + /** + * @since 28.0.0 + */ + public function __construct( + protected IUser $user, + protected int $fileId, + protected string $path, + ) { + parent::__construct(); + } + + /** + * @since 28.0.0 + */ + public function getUser(): IUser { + return $this->user; + } + + /** + * @since 28.0.0 + */ + public function getFileId(): int { + return $this->fileId; + } + + /** + * @since 28.0.0 + */ + public function getPath(): string { + return $this->path; + } +} diff --git a/lib/public/Files/Events/NodeRemovedFromFavorite.php b/lib/public/Files/Events/NodeRemovedFromFavorite.php new file mode 100644 index 00000000000..72b43558bec --- /dev/null +++ b/lib/public/Files/Events/NodeRemovedFromFavorite.php @@ -0,0 +1,66 @@ +<?php + +declare(strict_types=1); + +/** + * @copyright Copyright (c) 2023 Joas Schilling <coding@schilljs.com> + * + * @author Joas Schilling <coding@schilljs.com> + * + * @license GNU AGPL version 3 or any later version + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as + * published by the Free Software Foundation, either version 3 of the + * License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Affero General Public License for more details. + * + * You should have received a copy of the GNU Affero General Public License + * along with this program. If not, see <http://www.gnu.org/licenses/>. + * + */ +namespace OCP\Files\Events; + +use OCP\EventDispatcher\Event; +use OCP\IUser; + +/** + * @since 28.0.0 + */ +class NodeRemovedFromFavorite extends Event { + /** + * @since 28.0.0 + */ + public function __construct( + protected IUser $user, + protected int $fileId, + protected string $path, + ) { + parent::__construct(); + } + + /** + * @since 28.0.0 + */ + public function getUser(): IUser { + return $this->user; + } + + /** + * @since 28.0.0 + */ + public function getFileId(): int { + return $this->fileId; + } + + /** + * @since 28.0.0 + */ + public function getPath(): string { + return $this->path; + } +} diff --git a/lib/public/IServerContainer.php b/lib/public/IServerContainer.php index f438838b98e..b66e1ecdf02 100644 --- a/lib/public/IServerContainer.php +++ b/lib/public/IServerContainer.php @@ -46,7 +46,6 @@ use OCP\Federation\ICloudFederationProviderManager; use OCP\Log\ILogFactory; use OCP\Security\IContentSecurityPolicyManager; use Psr\Container\ContainerInterface; -use Symfony\Component\EventDispatcher\EventDispatcherInterface; /** * This is a tagging interface for the server container @@ -517,15 +516,6 @@ interface IServerContainer extends ContainerInterface, IContainer { public function getMimeTypeLoader(); /** - * Get the EventDispatcher - * - * @return EventDispatcherInterface - * @deprecated 20.0.0 use \OCP\EventDispatcher\IEventDispatcher - * @since 8.2.0 - */ - public function getEventDispatcher(); - - /** * Get the Notification Manager * * @return \OCP\Notification\IManager diff --git a/lib/public/Share/Events/BeforeShareCreatedEvent.php b/lib/public/Share/Events/BeforeShareCreatedEvent.php new file mode 100644 index 00000000000..f69049b3e8d --- /dev/null +++ b/lib/public/Share/Events/BeforeShareCreatedEvent.php @@ -0,0 +1,66 @@ +<?php + +declare(strict_types=1); + +/** + * @copyright Copyright (c) 2023 Joas Schilling <coding@schilljs.com> + * + * @author Joas Schilling <coding@schilljs.com> + * + * @license GNU AGPL version 3 or any later version + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as + * published by the Free Software Foundation, either version 3 of the + * License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Affero General Public License for more details. + * + * You should have received a copy of the GNU Affero General Public License + * along with this program. If not, see <http://www.gnu.org/licenses/>. + * + */ +namespace OCP\Share\Events; + +use OCP\EventDispatcher\Event; +use OCP\Share\IShare; + +/** + * @since 28.0.0 + */ +class BeforeShareCreatedEvent extends Event { + private ?string $error = null; + + /** + * @since 28.0.0 + */ + public function __construct( + private IShare $share, + ) { + parent::__construct(); + } + + /** + * @since 28.0.0 + */ + public function getShare(): IShare { + return $this->share; + } + + /** + * @since 28.0.0 + */ + public function setError(string $error): void { + $this->error = $error; + } + + /** + * @since 28.0.0 + */ + public function getError(): ?string { + return $this->error; + } +} diff --git a/lib/public/Share/Events/BeforeShareDeletedEvent.php b/lib/public/Share/Events/BeforeShareDeletedEvent.php new file mode 100644 index 00000000000..854d8d95b8d --- /dev/null +++ b/lib/public/Share/Events/BeforeShareDeletedEvent.php @@ -0,0 +1,50 @@ +<?php + +declare(strict_types=1); + +/** + * @copyright Copyright (c) 2023 Joas Schilling <coding@schilljs.com> + * + * @author Joas Schilling <coding@schilljs.com> + * + * @license GNU AGPL version 3 or any later version + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as + * published by the Free Software Foundation, either version 3 of the + * License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Affero General Public License for more details. + * + * You should have received a copy of the GNU Affero General Public License + * along with this program. If not, see <http://www.gnu.org/licenses/>. + * + */ +namespace OCP\Share\Events; + +use OCP\EventDispatcher\Event; +use OCP\Share\IShare; + +/** + * @since 28.0.0 + */ +class BeforeShareDeletedEvent extends Event { + /** + * @since 28.0.0 + */ + public function __construct( + private IShare $share, + ) { + parent::__construct(); + } + + /** + * @since 28.0.0 + */ + public function getShare(): IShare { + return $this->share; + } +} diff --git a/lib/public/Share/Events/ShareAcceptedEvent.php b/lib/public/Share/Events/ShareAcceptedEvent.php new file mode 100644 index 00000000000..bf2b8084d8e --- /dev/null +++ b/lib/public/Share/Events/ShareAcceptedEvent.php @@ -0,0 +1,50 @@ +<?php + +declare(strict_types=1); + +/** + * @copyright Copyright (c) 2023 Joas Schilling <coding@schilljs.com> + * + * @author Joas Schilling <coding@schilljs.com> + * + * @license GNU AGPL version 3 or any later version + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as + * published by the Free Software Foundation, either version 3 of the + * License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Affero General Public License for more details. + * + * You should have received a copy of the GNU Affero General Public License + * along with this program. If not, see <http://www.gnu.org/licenses/>. + * + */ +namespace OCP\Share\Events; + +use OCP\EventDispatcher\Event; +use OCP\Share\IShare; + +/** + * @since 28.0.0 + */ +class ShareAcceptedEvent extends Event { + /** + * @since 28.0.0 + */ + public function __construct( + private IShare $share, + ) { + parent::__construct(); + } + + /** + * @since 28.0.0 + */ + public function getShare(): IShare { + return $this->share; + } +} diff --git a/lib/public/Share/Events/ShareDeletedFromSelfEvent.php b/lib/public/Share/Events/ShareDeletedFromSelfEvent.php new file mode 100644 index 00000000000..0bcc7e8cf73 --- /dev/null +++ b/lib/public/Share/Events/ShareDeletedFromSelfEvent.php @@ -0,0 +1,50 @@ +<?php + +declare(strict_types=1); + +/** + * @copyright Copyright (c) 2023 Joas Schilling <coding@schilljs.com> + * + * @author Joas Schilling <coding@schilljs.com> + * + * @license GNU AGPL version 3 or any later version + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as + * published by the Free Software Foundation, either version 3 of the + * License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Affero General Public License for more details. + * + * You should have received a copy of the GNU Affero General Public License + * along with this program. If not, see <http://www.gnu.org/licenses/>. + * + */ +namespace OCP\Share\Events; + +use OCP\EventDispatcher\Event; +use OCP\Share\IShare; + +/** + * @since 28.0.0 + */ +class ShareDeletedFromSelfEvent extends Event { + /** + * @since 28.0.0 + */ + public function __construct( + private IShare $share, + ) { + parent::__construct(); + } + + /** + * @since 28.0.0 + */ + public function getShare(): IShare { + return $this->share; + } +} diff --git a/lib/public/SpeechToText/ISpeechToTextManager.php b/lib/public/SpeechToText/ISpeechToTextManager.php index eff00ec0fa1..96973cfca08 100644 --- a/lib/public/SpeechToText/ISpeechToTextManager.php +++ b/lib/public/SpeechToText/ISpeechToTextManager.php @@ -41,6 +41,12 @@ interface ISpeechToTextManager { public function hasProviders(): bool; /** + * @return ISpeechToTextProvider[] + * @since 27.1.0 + */ + public function getProviders(): array; + + /** * Will schedule a transcription process in the background. The result will become available * with the \OCP\SpeechToText\Events\TranscriptionFinishedEvent * You should add context information to the context array to re-identify the transcription result as diff --git a/lib/public/TextProcessing/FreePromptTaskType.php b/lib/public/TextProcessing/FreePromptTaskType.php index dcc27df77c9..2cb8d6b7946 100644 --- a/lib/public/TextProcessing/FreePromptTaskType.php +++ b/lib/public/TextProcessing/FreePromptTaskType.php @@ -26,21 +26,25 @@ declare(strict_types=1); namespace OCP\TextProcessing; use OCP\IL10N; +use OCP\L10N\IFactory; /** * This is the text processing task type for free prompting * @since 27.1.0 */ class FreePromptTaskType implements ITaskType { + private IL10N $l; + /** * Constructor for FreePromptTaskType * - * @param IL10N $l + * @param IFactory $l10nFactory * @since 27.1.0 */ public function __construct( - private IL10N $l, + IFactory $l10nFactory, ) { + $this->l = $l10nFactory->get('core'); } @@ -57,6 +61,6 @@ class FreePromptTaskType implements ITaskType { * @since 27.1.0 */ public function getDescription(): string { - return $this->l->t('Runs an arbitrary prompt through the built-in language model.'); + return $this->l->t('Runs an arbitrary prompt through the language model.'); } } diff --git a/lib/public/TextProcessing/HeadlineTaskType.php b/lib/public/TextProcessing/HeadlineTaskType.php index ad38848ea87..7061ca1d69b 100644 --- a/lib/public/TextProcessing/HeadlineTaskType.php +++ b/lib/public/TextProcessing/HeadlineTaskType.php @@ -26,21 +26,25 @@ declare(strict_types=1); namespace OCP\TextProcessing; use OCP\IL10N; +use OCP\L10N\IFactory; /** * This is the text processing task type for creating headline * @since 27.1.0 */ class HeadlineTaskType implements ITaskType { + private IL10N $l; + /** * Constructor for HeadlineTaskType * - * @param IL10N $l + * @param IFactory $l10nFactory * @since 27.1.0 */ public function __construct( - private IL10N $l, + IFactory $l10nFactory, ) { + $this->l = $l10nFactory->get('core'); } @@ -57,6 +61,6 @@ class HeadlineTaskType implements ITaskType { * @since 27.1.0 */ public function getDescription(): string { - return $this->l->t('Generates a possible headline for a text'); + return $this->l->t('Generates a possible headline for a text.'); } } diff --git a/lib/public/TextProcessing/IManager.php b/lib/public/TextProcessing/IManager.php index 90e25894d4f..dec0baba4bb 100644 --- a/lib/public/TextProcessing/IManager.php +++ b/lib/public/TextProcessing/IManager.php @@ -42,6 +42,12 @@ interface IManager { public function hasProviders(): bool; /** + * @return IProvider[] + * @since 27.1.0 + */ + public function getProviders(): array; + + /** * @return class-string<ITaskType>[] * @since 27.1.0 */ @@ -67,6 +73,14 @@ interface IManager { public function scheduleTask(Task $task) : void; /** + * Delete a task that has been scheduled before + * + * @param Task $task The task to delete + * @since 27.1.0 + */ + public function deleteTask(Task $task): void; + + /** * @param int $id The id of the task * @return Task * @throws RuntimeException If the query failed @@ -74,4 +88,23 @@ interface IManager { * @since 27.1.0 */ public function getTask(int $id): Task; + + /** + * @param int $id The id of the task + * @param string|null $userId The user id that scheduled the task + * @return Task + * @throws RuntimeException If the query failed + * @throws NotFoundException If the task could not be found + * @since 27.1.0 + */ + public function getUserTask(int $id, ?string $userId): Task; + + /** + * @param string $userId + * @param string $appId + * @param string|null $identifier + * @return array + * @since 27.1.0 + */ + public function getUserTasksByApp(string $userId, string $appId, ?string $identifier = null): array; } diff --git a/lib/public/TextProcessing/SummaryTaskType.php b/lib/public/TextProcessing/SummaryTaskType.php index 3d80cee47f8..670a7cb4da6 100644 --- a/lib/public/TextProcessing/SummaryTaskType.php +++ b/lib/public/TextProcessing/SummaryTaskType.php @@ -26,21 +26,25 @@ declare(strict_types=1); namespace OCP\TextProcessing; use OCP\IL10N; +use OCP\L10N\IFactory; /** * This is the text processing task type for summaries * @since 27.1.0 */ class SummaryTaskType implements ITaskType { + private IL10N $l; + /** * Constructor for SummaryTaskType * - * @param IL10N $l + * @param IFactory $l10nFactory * @since 27.1.0 */ public function __construct( - private IL10N $l, + IFactory $l10nFactory, ) { + $this->l = $l10nFactory->get('core'); } diff --git a/lib/public/TextProcessing/TopicsTaskType.php b/lib/public/TextProcessing/TopicsTaskType.php index 6162b9a13e9..5a994a7a8d2 100644 --- a/lib/public/TextProcessing/TopicsTaskType.php +++ b/lib/public/TextProcessing/TopicsTaskType.php @@ -26,21 +26,25 @@ declare(strict_types=1); namespace OCP\TextProcessing; use OCP\IL10N; +use OCP\L10N\IFactory; /** * This is the text processing task type for topics extraction * @since 27.1.0 */ class TopicsTaskType implements ITaskType { + private IL10N $l; + /** * Constructor for TopicsTaskType * - * @param IL10N $l + * @param IFactory $l10nFactory * @since 27.1.0 */ public function __construct( - private IL10N $l, + IFactory $l10nFactory, ) { + $this->l = $l10nFactory->get('core'); } diff --git a/lib/public/Translation/ITranslationManager.php b/lib/public/Translation/ITranslationManager.php index 4450f19c424..5b342faea75 100644 --- a/lib/public/Translation/ITranslationManager.php +++ b/lib/public/Translation/ITranslationManager.php @@ -39,6 +39,12 @@ interface ITranslationManager { public function hasProviders(): bool; /** + * @return ITranslationProvider[] + * @since 27.1.0 + */ + public function getProviders(): array; + + /** * @since 26.0.0 */ public function canDetectLanguage(): bool; diff --git a/lib/public/User/Events/UserFirstTimeLoggedInEvent.php b/lib/public/User/Events/UserFirstTimeLoggedInEvent.php new file mode 100644 index 00000000000..06491f79109 --- /dev/null +++ b/lib/public/User/Events/UserFirstTimeLoggedInEvent.php @@ -0,0 +1,50 @@ +<?php + +declare(strict_types=1); + +/** + * @copyright Copyright (c) 2023 Joas Schilling <coding@schilljs.com> + * + * @author Joas Schilling <coding@schilljs.com> + * + * @license GNU AGPL version 3 or any later version + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as + * published by the Free Software Foundation, either version 3 of the + * License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Affero General Public License for more details. + * + * You should have received a copy of the GNU Affero General Public License + * along with this program. If not, see <http://www.gnu.org/licenses/>. + * + */ +namespace OCP\User\Events; + +use OCP\EventDispatcher\Event; +use OCP\IUser; + +/** + * @since 28.0.0 + */ +class UserFirstTimeLoggedInEvent extends Event { + /** + * @since 28.0.0 + */ + public function __construct( + private IUser $user, + ) { + parent::__construct(); + } + + /** + * @since 28.0.0 + */ + public function getUser(): IUser { + return $this->user; + } +} |