Skip to content

fix(federatedfilesharing): add a link to the "remote share received" activity - #65799

Open
MarioPym wants to merge 2 commits into
nextcloud:masterfrom
MarioPym:fix/link-remote-share-received-activity
Open

MarioPym wants to merge 2 commits into
nextcloud:masterfrom
MarioPym:fix/link-remote-share-received-activity

Conversation

@MarioPym

Copy link
Copy Markdown

Summary

When a federated share is received, the "You received a new remote share … from …" activity is published without a link, so clicking it in the activity stream does nothing. The other remote share activities of the same provider (accepted, declined) already set a link.

This adds a link to the Files view where the user can find the share:

  • Pending shares (/apps/files/pendingshares) when the share waits to be accepted.
  • Shared with you (/apps/files/sharingin) when it is auto-accepted from a trusted server.

The link is set for user shares and for every member of a group share. The auto-accept condition is now computed once and reused in both branches.

How to test

  1. Share a file or folder from a remote server with a local user (federated share).
  2. As the recipient, open the Activity app, or call GET /ocs/v2.php/apps/activity/api/v2/activity/all:
    • Before: the "You received a new remote share" entry has an empty link and is not clickable.
    • After: link is https://your-server/index.php/apps/files/pendingshares and opens the Pending shares view.
  3. With "Automatically accept shares from trusted federated servers" enabled and the remote added as a trusted server, the link points to /apps/files/sharingin.

Unit tests: apps/federatedfilesharing/tests/OCM/CloudFederationProviderFilesTest.php (pending user share, group share with one event per member, auto-accepted share).

Checklist

AI (if applicable)

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

…activity

Assisted-by: ClaudeCode:claude-opus-5-5
Signed-off-by: Mario Alfonso Pym Mejía <pymm@hitss.com>
@MarioPym
MarioPym force-pushed the fix/link-remote-share-received-activity branch from 95d4950 to a6390bf Compare October 23, 2026 06:39

This branch has not been deployed

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant