Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(stream): Don't render avatar for federated users #1744

Merged
merged 2 commits into from
Aug 1, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion js/Activity.chunk.mjs

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion js/Activity.chunk.mjs.map

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion js/vendor.LICENSE.txt
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ version: 2.1.0
license: GPL-3.0-or-later

@nextcloud/l10n
version: 2.2.0
version: 3.1.0
license: GPL-3.0-or-later

@nextcloud/logger
Expand Down
11 changes: 11 additions & 0 deletions src/utils/richObjects.ts
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,17 @@ export function mapRichObjectToRichArgument(richObject: IRichObject) {
props: richObject,
}
case 'user':
if (richObject.server) {
return {
component: NcUserBubble,
props: {
avatarImage: 'icon-user',
displayName: richObject.name,
user: richObject.id,
url: richObject.link,
},
}
}
Comment on lines +49 to +59
Copy link

Choose a reason for hiding this comment

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

Maybe replace existing code with it to avoid duplications?

Suggested change
if (richObject.server) {
return {
component: NcUserBubble,
props: {
avatarImage: 'icon-user',
displayName: richObject.name,
user: richObject.id,
url: richObject.link,
},
}
}
return {
component: NcUserBubble,
props: {
// show thumbnail for federated users
avatarImage: richObject.server ? 'icon-user' : undefined,
displayName: richObject.name,
user: richObject.id,
url: richObject.link,
},
}

return {
component: NcUserBubble,
props: { displayName: richObject.name, user: richObject.id, url: richObject.link },
Expand Down
Loading