diff --git a/app/javascript/mastodon/actions/importer/index.js b/app/javascript/mastodon/actions/importer/index.js
index d906bdfb14..516a7a7973 100644
--- a/app/javascript/mastodon/actions/importer/index.js
+++ b/app/javascript/mastodon/actions/importer/index.js
@@ -76,8 +76,8 @@ export function importFetchedStatuses(statuses) {
pushUnique(polls, normalizePoll(status.poll, getState().getIn(['polls', status.poll.id])));
}
- if (status.card?.author_account) {
- pushUnique(accounts, status.card.author_account);
+ if (status.card) {
+ status.card.authors.forEach(author => author.account && pushUnique(accounts, author.account));
}
}
diff --git a/app/javascript/mastodon/actions/importer/normalizer.js b/app/javascript/mastodon/actions/importer/normalizer.js
index be76b0f391..c09a3f442c 100644
--- a/app/javascript/mastodon/actions/importer/normalizer.js
+++ b/app/javascript/mastodon/actions/importer/normalizer.js
@@ -36,8 +36,15 @@ export function normalizeStatus(status, normalOldStatus) {
normalStatus.poll = status.poll.id;
}
- if (status.card?.author_account) {
- normalStatus.card = { ...status.card, author_account: status.card.author_account.id };
+ if (status.card) {
+ normalStatus.card = {
+ ...status.card,
+ authors: status.card.authors.map(author => ({
+ ...author,
+ accountId: author.account?.id,
+ account: undefined,
+ })),
+ };
}
if (status.filtered) {
diff --git a/app/javascript/mastodon/actions/trends.js b/app/javascript/mastodon/actions/trends.js
index 01089fccbb..0bdf17a5d2 100644
--- a/app/javascript/mastodon/actions/trends.js
+++ b/app/javascript/mastodon/actions/trends.js
@@ -51,7 +51,7 @@ export const fetchTrendingLinks = () => (dispatch) => {
api()
.get('/api/v1/trends/links', { params: { limit: 20 } })
.then(({ data }) => {
- dispatch(importFetchedAccounts(data.map(link => link.author_account).filter(account => !!account)));
+ dispatch(importFetchedAccounts(data.flatMap(link => link.authors.map(author => author.account)).filter(account => !!account)));
dispatch(fetchTrendingLinksSuccess(data));
})
.catch(err => dispatch(fetchTrendingLinksFail(err)));
diff --git a/app/javascript/mastodon/api_types/statuses.ts b/app/javascript/mastodon/api_types/statuses.ts
index c7dd33b5da..db4e20506f 100644
--- a/app/javascript/mastodon/api_types/statuses.ts
+++ b/app/javascript/mastodon/api_types/statuses.ts
@@ -30,6 +30,12 @@ export interface ApiMentionJSON {
acct: string;
}
+export interface ApiPreviewCardAuthorJSON {
+ name: string;
+ url: string;
+ account?: ApiAccountJSON;
+}
+
export interface ApiPreviewCardJSON {
url: string;
title: string;
@@ -48,6 +54,7 @@ export interface ApiPreviewCardJSON {
embed_url: string;
blurhash: string;
published_at: string;
+ authors: ApiPreviewCardAuthorJSON[];
}
export interface ApiStatusJSON {
diff --git a/app/javascript/mastodon/features/explore/components/author_link.jsx b/app/javascript/mastodon/features/explore/components/author_link.jsx
index 8dd9b0dabd..764ae75341 100644
--- a/app/javascript/mastodon/features/explore/components/author_link.jsx
+++ b/app/javascript/mastodon/features/explore/components/author_link.jsx
@@ -8,6 +8,10 @@ import { useAppSelector } from 'mastodon/store';
export const AuthorLink = ({ accountId }) => {
const account = useAppSelector(state => state.getIn(['accounts', accountId]));
+ if (!account) {
+ return null;
+ }
+
return (