diff --git a/app/javascript/mastodon/features/quotes/index.tsx b/app/javascript/mastodon/features/quotes/index.tsx index d0290e11185..56cf2f71f11 100644 --- a/app/javascript/mastodon/features/quotes/index.tsx +++ b/app/javascript/mastodon/features/quotes/index.tsx @@ -12,6 +12,8 @@ import { ColumnHeader } from 'mastodon/components/column_header'; import { Icon } from 'mastodon/components/icon'; import { LoadingIndicator } from 'mastodon/components/loading_indicator'; import StatusList from 'mastodon/components/status_list'; +import { useIdentity } from 'mastodon/identity_context'; +import { domain } from 'mastodon/initial_state'; import { useAppDispatch, useAppSelector } from 'mastodon/store'; import Column from '../ui/components/column'; @@ -31,9 +33,18 @@ export const Quotes: React.FC<{ const statusId = params?.statusId; + const { accountId: me } = useIdentity(); + const isCorrectStatusId: boolean = useAppSelector( (state) => state.status_lists.getIn(['quotes', 'statusId']) === statusId, ); + const quotedAccountId = useAppSelector( + (state) => + state.statuses.getIn([statusId, 'account']) as string | undefined, + ); + const quotedAccount = useAppSelector((state) => + quotedAccountId ? state.accounts.get(quotedAccountId) : undefined, + ); const statusIds = useAppSelector((state) => state.status_lists.getIn(['quotes', 'items'], emptyList), ); @@ -74,6 +85,32 @@ export const Quotes: React.FC<{ /> ); + let prependMessage; + + if (me === quotedAccountId) { + prependMessage = null; + } else if (quotedAccount?.username === quotedAccount?.acct) { + // Local account, we know this to be exhaustive + prependMessage = ( +
+ +
+ ); + } else { + prependMessage = ( +
+ {domain} }} + /> +
+ ); + } + return ( diff --git a/app/javascript/mastodon/features/status/components/detailed_status.tsx b/app/javascript/mastodon/features/status/components/detailed_status.tsx index 957364fd7a7..b09e109afb2 100644 --- a/app/javascript/mastodon/features/status/components/detailed_status.tsx +++ b/app/javascript/mastodon/features/status/components/detailed_status.tsx @@ -31,7 +31,7 @@ import { VisibilityIcon } from 'mastodon/components/visibility_icon'; import { Audio } from 'mastodon/features/audio'; import scheduleIdleTask from 'mastodon/features/ui/util/schedule_idle_task'; import { Video } from 'mastodon/features/video'; -import { me } from 'mastodon/initial_state'; +import { useIdentity } from 'mastodon/identity_context'; import Card from './card'; @@ -75,6 +75,8 @@ export const DetailedStatus: React.FC<{ const [showDespiteFilter, setShowDespiteFilter] = useState(false); const nodeRef = useRef(); + const { signedIn } = useIdentity(); + const handleOpenVideo = useCallback( (options: VideoModalOptions) => { const lang = (status.getIn(['translation', 'language']) || @@ -283,7 +285,7 @@ export const DetailedStatus: React.FC<{ if (['private', 'direct'].includes(status.get('visibility') as string)) { quotesLink = ''; - } else if (status.getIn(['account', 'id']) === me) { + } else if (signedIn) { quotesLink = (