Skip to content

Conversation

@cristianscheid
Copy link
Contributor

@cristianscheid cristianscheid commented Jan 24, 2026

Summary

Adds possibility to search for federated users (accounts from other instances) and federated groups when adding members to a team in the Contacts app.

Context

When searching for members to add to a team in the Contacts app, a GET request is made to ocs/v2.php/apps/files_sharing/api/v1/sharees which in turn calls files_sharing/lib/Controller/ShareesAPIController::search().

This is the same endpoint used by the Files app when searching to add an external share (used as a reference here, as pointed out in the issue).

Changes

  • Modified files_sharing/lib/Controller/ShareesAPIController::search() to handle contacts itemType, allowing TYPE_REMOTE and TYPE_REMOTE_GROUP searches
  • Injected FederatedShareProvider into the controller constructor to check federation settings
  • Called federation check methods directly via FederatedShareProvider
    • The wrapper methods isRemoteSharingAllowed() and isRemoteGroupSharingAllowed() require a share backend implementation
    • They call isShareTypeAllowed(), which ultimately invokes the same FederatedShareProvider methods used in this implementation (isOutgoingServer2serverShareEnabled() and isOutgoingServer2serverGroupShareEnabled())
    • Since contacts doesn't have a registered share backend (similar to calendar), this direct approach was taken to achieve same functionality

Note

When testing locally, the federated search functionality works correctly (remote users appear in search results). However, when attempting to actually add the remote member to a team, an error occurs indicating the remote instance is unreachable. I believe this is expected behavior when running locally, as a similar error occurs when trying to add an external share in the Files app using the same remote account, which is the reference implementation mentioned in the issue and was not modified in this PR.

Checklist

…m members

Signed-off-by: Cristian Scheid <cristianscheid@gmail.com>
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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants