Skip to content

feat(files_sharing): fetch remote avatars for external shares#62355

Open
leftybournes wants to merge 2 commits into
masterfrom
leftybournes/feat/federatedshares-show-avatars
Open

feat(files_sharing): fetch remote avatars for external shares#62355
leftybournes wants to merge 2 commits into
masterfrom
leftybournes/feat/federatedshares-show-avatars

Conversation

@leftybournes

Copy link
Copy Markdown
Member
  • Resolves: #

Summary

Currently, external shares always show a GuestAvatar in the files list. This adds functionality to fetch the remote sharer's avatar.

Checklist

AI (if applicable)

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

@leftybournes leftybournes added this to the Nextcloud 35 milestone Jul 21, 2026
@leftybournes
leftybournes requested a review from a team as a code owner July 21, 2026 05:35
@leftybournes
leftybournes requested review from Altahrim, come-nc, nfebe and salmart-dev and removed request for a team July 21, 2026 05:35
@leftybournes
leftybournes force-pushed the leftybournes/feat/federatedshares-show-avatars branch from e064efd to b8f517f Compare July 21, 2026 05:47
@leftybournes
leftybournes force-pushed the leftybournes/feat/federatedshares-show-avatars branch 2 times, most recently from 5f1c880 to a17c574 Compare July 21, 2026 06:20
Comment on lines +69 to +72
$contentType = $response->getHeader('Content-Type');
if ($contentType !== 'image/png') {
throw new \Exception('Unknown filetype');
}

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.

That seems a bit strict. If a user uploads their own avatar it is probably stored and served in the original format.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

I modified it to also check for jpgs

Comment thread lib/private/Avatar/RemoteAvatar.php Outdated
}
}

return new InMemoryFile('avatar.png', $avatar);

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.

so it's downloading the avatar each time? It might make sense to cache it for a bit

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Implemented it so that it downloads the avatar once a day (in case the remote user changed their avatar). Can you please give it a look?

Signed-off-by: Kent Delante <kent@delante.me>
Assisted-by: ClaudeCode:claude-sonnet-5
Signed-off-by: Kent Delante <kent@delante.me>
Assisted-by: ClaudeCode:claude-sonnet-5
@leftybournes
leftybournes force-pushed the leftybournes/feat/federatedshares-show-avatars branch from a17c574 to 318668e Compare July 22, 2026 08:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants