Skip to content

Add Unified Sharing#62241

Open
provokateurin wants to merge 5 commits into
masterfrom
unified-sharing
Open

Add Unified Sharing#62241
provokateurin wants to merge 5 commits into
masterfrom
unified-sharing

Conversation

@provokateurin

Copy link
Copy Markdown
Member

Summary

#51803

Checklist

AI (if applicable)

  • The content of this PR was partly or fully generated using AI

@provokateurin provokateurin added this to the Nextcloud 35 milestone Jul 16, 2026
@provokateurin provokateurin requested a review from a team as a code owner July 16, 2026 12:39
@provokateurin provokateurin requested review from Altahrim and come-nc and removed request for a team July 16, 2026 12:39
Comment on lines +107 to +109
$registry = Server::get(ISharingRegistry::class);

$registry->registerSourceType(Server::get(NodeShareSourceType::class));

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Looks weird to me that register is pulling instances from Server::get.
It’s usually registering classnames in the context that later gets vivified if needed.
Or you can use injectFn in boot and you get proper DI.

(I do not have context for this, feel free to ignore if not relevant)

* SPDX-License-Identifier: AGPL-3.0-or-later
*/

declare(strict_types=1);

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

declare should be before licenses to match other files style.

Comment on lines +20 to +24
private ?IAppConfig $appConfig = null;

private function getAppConfig(): IAppConfig {
return $this->appConfig ??= Server::get(IAppConfig::class);
}

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

How come this is needed and proper DI cannot be used?
(Precisely because these classes get built in register and not boot?)

Comment thread apps/sharing/tests/Command/CommandTest.php
Signed-off-by: provokateurin <kate@provokateurin.de>
Signed-off-by: provokateurin <kate@provokateurin.de>
Signed-off-by: provokateurin <kate@provokateurin.de>
Signed-off-by: provokateurin <kate@provokateurin.de>
Signed-off-by: provokateurin <kate@provokateurin.de>
* @since 35.0.0
*/
public function format(IUserManager $userManager): array {
$ownerUser = $userManager->get($this->userId);

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Can this use IUserManager::getExistingUser instead (if the instance is local)?

* @since 35.0.0
*/
#[Consumable(since: '35.0.0')]
final readonly class ShareIconSVG {

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

It might make sense to move the icon classes outside the share namespace, so they could be used for non-sharing dynamic icon registration in the future.

/** @var array<int, array<class-string<IShareRecipientType>, bool>> $shareRecipientTypeClasses */
$shareRecipientTypeClasses = [];
foreach ($chunks as $chunk) {
$qb = $this->connection->getQueryBuilder();

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

in most cases, we have already done a query on recipients above when finding share ids, probably worth fetching this data then instead.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

3. to review Waiting for reviews enhancement

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants