aboutsummaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
Diffstat (limited to 'lib')
-rw-r--r--lib/l10n/uk.js1
-rw-r--r--lib/l10n/uk.json1
-rw-r--r--lib/private/AppConfig.php12
-rw-r--r--lib/private/Preview/Watcher.php3
-rw-r--r--lib/private/Preview/WatcherConnector.php32
-rw-r--r--lib/private/Server.php3
6 files changed, 26 insertions, 26 deletions
diff --git a/lib/l10n/uk.js b/lib/l10n/uk.js
index 3d29de9a772..f63a5bda6bb 100644
--- a/lib/l10n/uk.js
+++ b/lib/l10n/uk.js
@@ -336,6 +336,7 @@ OC.L10N.register(
"Generate image" : "Зґенерувати зображення",
"Prompt" : "Запрошення",
"Chat" : "Чат",
+ "Available tools" : "Доступні інструменти",
"Generates a possible headline for a text." : "Створює ймовірний заголовок тексту.",
"Text" : "Текст",
"Summarize" : "Підсумок",
diff --git a/lib/l10n/uk.json b/lib/l10n/uk.json
index 4a4fba617b4..dec967a6c07 100644
--- a/lib/l10n/uk.json
+++ b/lib/l10n/uk.json
@@ -334,6 +334,7 @@
"Generate image" : "Зґенерувати зображення",
"Prompt" : "Запрошення",
"Chat" : "Чат",
+ "Available tools" : "Доступні інструменти",
"Generates a possible headline for a text." : "Створює ймовірний заголовок тексту.",
"Text" : "Текст",
"Summarize" : "Підсумок",
diff --git a/lib/private/AppConfig.php b/lib/private/AppConfig.php
index 1228b9c20e3..092d37c3338 100644
--- a/lib/private/AppConfig.php
+++ b/lib/private/AppConfig.php
@@ -1423,6 +1423,9 @@ class AppConfig implements IAppConfig {
'globalsiteselector' => [
'/^gss\.jwt\.key$/',
],
+ 'gpgmailer' => [
+ '/^GpgServerKey$/',
+ ],
'integration_discourse' => [
'/^private_key$/',
'/^public_key$/',
@@ -1477,6 +1480,9 @@ class AppConfig implements IAppConfig {
'/^client_secret$/',
'/^oauth_instance_url$/',
],
+ 'maps' => [
+ '/^mapboxAPIKEY$/',
+ ],
'notify_push' => [
'/^cookie$/',
],
@@ -1514,12 +1520,12 @@ class AppConfig implements IAppConfig {
'/^slogan$/',
'/^url$/',
],
- 'user_ldap' => [
- '/^(s..)?ldap_agent_password$/',
- ],
'twofactor_gateway' => [
'/^.*token$/',
],
+ 'user_ldap' => [
+ '/^(s..)?ldap_agent_password$/',
+ ],
'user_saml' => [
'/^idp-x509cert$/',
],
diff --git a/lib/private/Preview/Watcher.php b/lib/private/Preview/Watcher.php
index abddd7b5acb..21f040d8342 100644
--- a/lib/private/Preview/Watcher.php
+++ b/lib/private/Preview/Watcher.php
@@ -8,6 +8,7 @@ declare(strict_types=1);
*/
namespace OC\Preview;
+use OCP\Files\FileInfo;
use OCP\Files\Folder;
use OCP\Files\IAppData;
use OCP\Files\Node;
@@ -37,7 +38,7 @@ class Watcher {
$this->deleteNode($node);
}
- protected function deleteNode(Node $node) {
+ protected function deleteNode(FileInfo $node) {
// We only handle files
if ($node instanceof Folder) {
return;
diff --git a/lib/private/Preview/WatcherConnector.php b/lib/private/Preview/WatcherConnector.php
index ae2a136ca78..c34dd1dde4d 100644
--- a/lib/private/Preview/WatcherConnector.php
+++ b/lib/private/Preview/WatcherConnector.php
@@ -9,43 +9,33 @@ declare(strict_types=1);
namespace OC\Preview;
use OC\SystemConfig;
+use OCA\Files_Versions\Events\VersionRestoredEvent;
+use OCP\EventDispatcher\IEventDispatcher;
use OCP\Files\IRootFolder;
use OCP\Files\Node;
class WatcherConnector {
- /** @var IRootFolder */
- private $root;
-
- /** @var SystemConfig */
- private $config;
-
- /**
- * WatcherConnector constructor.
- *
- * @param IRootFolder $root
- * @param SystemConfig $config
- */
- public function __construct(IRootFolder $root,
- SystemConfig $config) {
- $this->root = $root;
- $this->config = $config;
+ public function __construct(
+ private IRootFolder $root,
+ private SystemConfig $config,
+ private IEventDispatcher $dispatcher,
+ ) {
}
- /**
- * @return Watcher
- */
private function getWatcher(): Watcher {
return \OCP\Server::get(Watcher::class);
}
- public function connectWatcher() {
+ public function connectWatcher(): void {
// Do not connect if we are not setup yet!
if ($this->config->getValue('instanceid', null) !== null) {
$this->root->listen('\OC\Files', 'postWrite', function (Node $node) {
$this->getWatcher()->postWrite($node);
});
- \OC_Hook::connect('\OCP\Versions', 'rollback', $this->getWatcher(), 'versionRollback');
+ $this->dispatcher->addListener(VersionRestoredEvent::class, function (VersionRestoredEvent $event) {
+ $this->getWatcher()->versionRollback(['node' => $event->getVersion()->getSourceFile()]);
+ });
}
}
}
diff --git a/lib/private/Server.php b/lib/private/Server.php
index 4d79fefd261..545ceacbe81 100644
--- a/lib/private/Server.php
+++ b/lib/private/Server.php
@@ -411,7 +411,8 @@ class Server extends ServerContainer implements IServerContainer {
$previewConnector = new \OC\Preview\WatcherConnector(
$root,
- $c->get(SystemConfig::class)
+ $c->get(SystemConfig::class),
+ $this->get(IEventDispatcher::class)
);
$previewConnector->connectWatcher();