Skip to content

fix(chat): load avatars of federated users - #7053

Merged
mahibi merged 10 commits into
masterfrom
fix/federated-chat-avatars
Nov 17, 2026
Merged

mahibi merged 10 commits into
masterfrom
fix/federated-chat-avatars

Conversation

@AndyScherzinger

@AndyScherzinger AndyScherzinger commented Nov 16, 2026 •

Copy link
Copy Markdown
Member

Avatars of federated users stayed on the placeholder in chat messages and mention chips. The chat requested them from the own server's /index.php/avatar/{cloudId} endpoint, which knows no such user. The federated branch was lost when the chat moved to Compose (96b4f43).

Chat avatars of federated users now use the Talk proxy endpoint /proxy/{token}/user-avatar/{size}?cloudId=…, as the participant list, calls, poll results and web already do. That endpoint requires a logged-in participant (#[RequireLoggedInParticipant]), so the avatar and mention chip requests in the chat now send the account's credentials. The orphaned ImageView.loadFederatedUserAvatar(ChatMessage) overload is removed.

As on web, federated authors are also shown with their server in brackets after their name, e.g. "Alice (cloud.example.com)", in the message, in quotes and in the reply preview.

The same applies to chat notifications, their conversation shortcuts and pinned messages (author and the user who pinned). The notification of a federated sender also showed the wrong avatar: the server sends the part of the cloud ID before the server as id and the server separately, so the avatar of a local user with that id was requested. It now comes from the proxy endpoint too.

The media viewer title and the shared items list show the server as well, also for media the viewer loads from the shared items API.

🖼️ Screenshots

🏚️ Before

grafik grafik

🏡 After

Light

grafik grafik

Dark

grafik grafik

🚧 TODO

  • Verify against a federated conversation on a real server

🏁 Checklist

  • ⛑️ Tests (unit and/or integration) are included or not needed
  • 🔖 Capability is checked or not needed
  • 🔙 Backport requests are created or not needed: /backport to stable-xx.x
  • 📅 Milestone is set
  • 🌸 PR title is meaningful (if it should be in the changelog: is it meaningful to users?)

🤖 AI (if applicable)

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

@github-actions

github-actions Bot commented Nov 16, 2026 •

Copy link
Copy Markdown
Contributor

📱 QA build

Download app-qa-debug.apk
QR code Open the QR code for this download
Commit 4d768b5
Version 7053
Available until 7 days after this build

The QA build installs alongside a released Nextcloud app, so you can keep
using your existing install while testing.

Downloading the file requires a GitHub account, so open this link on the
device you want to test on, or transfer the APK to it.

@AndyScherzinger AndyScherzinger added this to the 26.0.0 milestone Nov 16, 2026
@AndyScherzinger AndyScherzinger added the enhancement New feature or request label Nov 16, 2026
@AndyScherzinger
AndyScherzinger force-pushed the fix/federated-chat-avatars branch from 7e572cb to a009e32 Compare November 16, 2026 16:06
@AndyScherzinger

Copy link
Copy Markdown
Member Author

/backport to stable-25.1.x

Messages of federated users requested their avatar from the own
server's avatar endpoint, which knows no user with that cloud ID, and
their mention chips requested it from the Talk proxy endpoint without
credentials, so only the placeholder was shown.

Their avatar is now requested from the Talk proxy endpoint of the
conversation, as in the participant list and on web. As that endpoint
requires a logged-in participant, avatar and mention chip requests for
federated users now carry the account's credentials, also in the
pinned message. Those for local users stay without credentials, as the
server answers them depending on who asks, while the image caches are
keyed by URL only.

Assisted-by: Claude Code:claude-opus-5-5
Signed-off-by: Andy Scherzinger <info@andy-scherzinger.de>
As on web, the author of a message from a federated user is shown
with their server in brackets, e.g. "Alice (cloud.example.com)", in
the message, in quotes and in the reply preview, so they can be told
apart from local users of the same name.

Assisted-by: Claude Code:claude-opus-5-5
Signed-off-by: Andy Scherzinger <info@andy-scherzinger.de>
Federated users are now shown with their server in brackets after
their name in chat notifications, their conversation shortcuts and
pinned messages, also when they pinned a message, as in the chat.

For a federated sender the notification's user object carries the
part of the cloud ID before the server as id and the server
separately. The sender's avatar was therefore requested for a local
user of that id, so it was missing or showed someone else's avatar.
It is now requested from the Talk proxy endpoint of the conversation,
and the notification person is keyed by the full cloud ID.

Assisted-by: Claude Code:claude-opus-5-5
Signed-off-by: Andy Scherzinger <info@andy-scherzinger.de>
Media and other items loaded from the shared items API name their
author by the actor parameter of the message only. Federated authors
are now shown with their server in brackets, as in the chat. This
covers the title of the media viewer for media it loads from there,
e.g. older media of a chat or media opened from the shared items, and
the author in the shared items list.

Assisted-by: Claude Code:claude-opus-5-5
Signed-off-by: Andy Scherzinger <info@andy-scherzinger.de>
The mention chip that the message input shows for a picked federated
user requested the avatar from the Talk proxy endpoint without
credentials. That endpoint only answers logged-in participants, so the
chip lost its icon, and every such request counted as a failed attempt
for the server's brute force protection.

The request for the avatar of a federated user now carries the
account's credentials, and a failed request keeps the default icon of
the chip.

Assisted-by: Claude Code:claude-opus-5-5
Signed-off-by: Andy Scherzinger <info@andy-scherzinger.de>
The call view requested the avatar of a federated participant from the
Talk proxy endpoint without credentials. The endpoint only answers
logged-in participants, so the tile showed no avatar, and every request
counted as a failed attempt for the server's brute force protection.

The participant grid now provides the account's credentials to its
images, and the tile of a federated participant sends them with the
avatar request.

Assisted-by: Claude Code:claude-opus-5-5
Signed-off-by: Andy Scherzinger <info@andy-scherzinger.de>
The avatar next to a message was clickable for every author, but only
the profile of users can be shown. For federated users, guests and bots
screen readers announced a button that did nothing when activated.

Assisted-by: Claude Code:claude-opus-5-5
Signed-off-by: Andy Scherzinger <info@andy-scherzinger.de>
@AndyScherzinger
AndyScherzinger force-pushed the fix/federated-chat-avatars branch from 240aa0c to 63792f3 Compare November 16, 2026 19:50
The avatar next to a message and the avatars in mention chips were
always requested in their light variant, while the call, the message
input and notifications follow the dark theme. Authors without a
picture got a light generated avatar in the dark theme.

The avatar URL of a message author was built in the view model, which
cannot tell the theme of the app. It is now built where the avatar is
drawn, so it follows the theme and changes with it. Mention chips get
the theme passed in as well.

Assisted-by: Claude Code:claude-opus-5-5
Signed-off-by: Marcel Hibbe <dev@mhibbe.de>
Mapping a message to its UI model encoded the account's credentials
for the avatar and mention chip requests again for every message, and
again for its quoted parent, each time the message list was rebuilt.

The chat and the scheduled messages now encode them once and hand the
same value to every message they map.

Assisted-by: Claude Code:claude-opus-5-5
Signed-off-by: Marcel Hibbe <dev@mhibbe.de>
…pants

The participant list gave no hint that a participant has their account
on another server. Like the web and iOS clients, the avatar of a
federated participant now carries a globe icon where the user status
is shown otherwise, as their user status is not available anyway.

Assisted-by: Claude Code:claude-opus-5-5
Signed-off-by: Marcel Hibbe <dev@mhibbe.de>
@github-actions

Copy link
Copy Markdown
Contributor

Codacy

Lint

TypemasterPR
Warnings1716
Errors00

SpotBugs

CategoryBaseNew
Bad practice77
Correctness88
Dodgy code4040
Internationalization33
Malicious code vulnerability33
Performance77
Security1111
Total7979

@mahibi
mahibi merged commit d693e95 into master Nov 17, 2026
20 of 21 checks passed
@mahibi
mahibi deleted the fix/federated-chat-avatars branch November 17, 2026 15:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants