Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions core/AppInfo/ConfigLexicon.php
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,8 @@ class ConfigLexicon implements ILexicon {
public const SHARE_LINK_EXPIRE_DATE_ENFORCED = 'shareapi_enforce_expire_date';
public const USER_LANGUAGE = 'lang';
public const OCM_DISCOVERY_ENABLED = 'ocm_discovery_enabled';
public const OCM_INVITE_ACCEPT_DIALOG = 'ocm_invite_accept_dialog';

public const USER_LOCALE = 'locale';
public const USER_TIMEZONE = 'timezone';

Expand Down Expand Up @@ -87,6 +89,7 @@ public function getAppConfigs(): array {
),
new Entry(self::LASTCRON_TIMESTAMP, ValueType::INT, 0, 'timestamp of last cron execution'),
new Entry(self::OCM_DISCOVERY_ENABLED, ValueType::BOOL, true, 'enable/disable OCM', lazy: true),
new Entry(self::OCM_INVITE_ACCEPT_DIALOG, ValueType::STRING, '', 'route to local invite accept dialog', lazy: true, note: 'set as empty string to disable feature'),
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why is that a setting, when is the route changing? How does the admin know the route?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this should be done by an app

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In case it needs a change, please do a follow-up PR

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I do not think it’s usual to use a setting for inter-app communication, I do not recall other occurences of that in the code.
Which application would fill this value?

];
}

Expand Down
5 changes: 3 additions & 2 deletions lib/private/OCM/Model/OCMProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -226,6 +226,7 @@ public function import(array $data): static {
$resources[] = $resource->import($resourceData);
}
$this->setResourceTypes($resources);
$this->setInviteAcceptDialog($data['inviteAcceptDialog'] ?? '');

if (isset($data['publicKey'])) {
// import details about the remote request signing public key, if available
Expand Down Expand Up @@ -271,11 +272,11 @@ public function jsonSerialize(): array {
];

$capabilities = $this->getCapabilities();
$inviteAcceptDialog = $this->getInviteAcceptDialog();
if ($capabilities) {
$response['capabilities'] = $capabilities;
}
if ($inviteAcceptDialog) {
$inviteAcceptDialog = $this->getInviteAcceptDialog();
if ($inviteAcceptDialog !== '') {
$response['inviteAcceptDialog'] = $inviteAcceptDialog;
}
return $response;
Expand Down
6 changes: 6 additions & 0 deletions lib/private/OCM/OCMDiscoveryService.php
Original file line number Diff line number Diff line change
Expand Up @@ -152,6 +152,12 @@ public function getLocalOCMProvider(bool $fullDetails = true): ICapabilityAwareO
$provider->setEndPoint(substr($url, 0, $pos));
$provider->setCapabilities(['/invite-accepted', '/notifications', '/shares']);

// The inviteAcceptDialog is available from the contacts app, if this config value is set
$inviteAcceptDialog = $this->appConfig->getValueString('core', ConfigLexicon::OCM_INVITE_ACCEPT_DIALOG);
if ($inviteAcceptDialog !== '') {
$provider->setInviteAcceptDialog($this->urlGenerator->linkToRouteAbsolute($inviteAcceptDialog));
}

$resource = $provider->createNewResourceType();
$resource->setName('file')
->setShareTypes(['user', 'group'])
Expand Down
Loading