mirror of
https://github.com/opencloud-eu/opencloud.git
synced 2026-11-26 10:07:34 -05:00
Users never got a notification when a federated instance shared something with them or removed that share again. The ocmcore service publishes OCMCoreShareCreated and OCMCoreShareDelete, but only when it has an events config, and the ocm service never passed one. We now pass the events config to ocmcore, and userlog turns both events into the regular "Resource shared" / "Resource unshared" notifications for the grantee. They honor the same in-app settings as local shares. The sharer is a federated user, so we look it up with GetAcceptedUser in the name of the grantee. That call has to go out without the service account token, otherwise the invite manager filters by the service account and finds nothing. If the lookup fails, e.g. because the federated connection was deleted, the notification says "Someone at <provider domain> shared <resource> with you" instead of showing an empty name. The federated id itself is "<uuid>@<issuer url>", which tells the reader nothing. Clients only fill in the known rich parameters, so we fill in the provider in the rich message ourselves. The resource lives on the remote instance. The notification points to the received share id for both events and carries the resource name without an id, so clients render it like a local share but don't build a link to a resource that does not exist here. Assisted-by: Claude Code:claude-opus-5-5 Signed-off-by: Jörn Friedrich Dreyer <jfd@butonic.de>