diff --git a/app/soapbox/features/account_gallery/index.js b/app/soapbox/features/account_gallery/index.js index 17e6e7be0..7689a58c0 100644 --- a/app/soapbox/features/account_gallery/index.js +++ b/app/soapbox/features/account_gallery/index.js @@ -17,6 +17,7 @@ import LoadingIndicator from 'soapbox/components/loading_indicator'; import MissingIndicator from 'soapbox/components/missing_indicator'; import SubNavigation from 'soapbox/components/sub_navigation'; import { getAccountGallery, findAccountByUsername } from 'soapbox/selectors'; +import { getFeatures } from 'soapbox/utils/features'; import { expandAccountMediaTimeline } from '../../actions/timelines'; @@ -26,6 +27,7 @@ const mapStateToProps = (state, { params, withReplies = false }) => { const username = params.username || ''; const me = state.get('me'); const accountFetchError = ((state.getIn(['accounts', -1, 'username']) || '').toLowerCase() === username.toLowerCase()); + const features = getFeatures(state.get('instance')); let accountId = -1; let accountUsername = username; @@ -38,7 +40,7 @@ const mapStateToProps = (state, { params, withReplies = false }) => { } const isBlocked = state.getIn(['relationships', accountId, 'blocked_by'], false); - const unavailable = (me === accountId) ? false : isBlocked; + const unavailable = (me === accountId) ? false : (isBlocked && !features.blockersVisible); return { accountId, diff --git a/app/soapbox/features/account_timeline/index.js b/app/soapbox/features/account_timeline/index.js index 6c2e55b81..ed3121a28 100644 --- a/app/soapbox/features/account_timeline/index.js +++ b/app/soapbox/features/account_timeline/index.js @@ -15,6 +15,7 @@ import Icon from 'soapbox/components/icon'; import MissingIndicator from 'soapbox/components/missing_indicator'; import SubNavigation from 'soapbox/components/sub_navigation'; import { makeGetStatusIds, findAccountByUsername } from 'soapbox/selectors'; +import { getFeatures } from 'soapbox/utils/features'; import { fetchAccount, fetchAccountByUsername } from '../../actions/accounts'; import { fetchAccountIdentityProofs } from '../../actions/identity_proofs'; @@ -31,6 +32,7 @@ const makeMapStateToProps = () => { const me = state.get('me'); const accountFetchError = ((state.getIn(['accounts', -1, 'username']) || '').toLowerCase() === username.toLowerCase()); const soapboxConfig = getSoapboxConfig(state); + const features = getFeatures(state.get('instance')); let accountId = -1; let accountUsername = username; @@ -47,7 +49,7 @@ const makeMapStateToProps = () => { const path = withReplies ? `${accountId}:with_replies` : accountId; const isBlocked = state.getIn(['relationships', accountId, 'blocked_by'], false); - const unavailable = (me === accountId) ? false : isBlocked; + const unavailable = (me === accountId) ? false : (isBlocked && !features.blockersVisible); const showPins = getSettings(state).getIn(['account_timeline', 'shows', 'pinned']) && !withReplies; return { diff --git a/app/soapbox/features/favourited_statuses/index.js b/app/soapbox/features/favourited_statuses/index.js index 8239b9071..723a2edbe 100644 --- a/app/soapbox/features/favourited_statuses/index.js +++ b/app/soapbox/features/favourited_statuses/index.js @@ -8,6 +8,7 @@ import { connect } from 'react-redux'; import MissingIndicator from 'soapbox/components/missing_indicator'; import { findAccountByUsername } from 'soapbox/selectors'; +import { getFeatures } from 'soapbox/utils/features'; import { fetchAccount, fetchAccountByUsername } from '../../actions/accounts'; import { fetchFavouritedStatuses, expandFavouritedStatuses, fetchAccountFavouritedStatuses, expandAccountFavouritedStatuses } from '../../actions/favourites'; @@ -26,6 +27,8 @@ const mapStateToProps = (state, { params }) => { const isMyAccount = (username.toLowerCase() === meUsername.toLowerCase()); + const features = getFeatures(state.get('instance')); + if (isMyAccount) { return { isMyAccount, @@ -46,7 +49,7 @@ const mapStateToProps = (state, { params }) => { } const isBlocked = state.getIn(['relationships', accountId, 'blocked_by'], false); - const unavailable = (me === accountId) ? false : isBlocked; + const unavailable = (me === accountId) ? false : (isBlocked && !features.blockersVisible); return { isMyAccount, diff --git a/app/soapbox/features/followers/index.js b/app/soapbox/features/followers/index.js index be3336fd0..ec1bfd8d5 100644 --- a/app/soapbox/features/followers/index.js +++ b/app/soapbox/features/followers/index.js @@ -9,6 +9,7 @@ import { connect } from 'react-redux'; import MissingIndicator from 'soapbox/components/missing_indicator'; import { findAccountByUsername } from 'soapbox/selectors'; import { getFollowDifference } from 'soapbox/utils/accounts'; +import { getFeatures } from 'soapbox/utils/features'; import { fetchAccount, @@ -29,6 +30,7 @@ const mapStateToProps = (state, { params, withReplies = false }) => { const username = params.username || ''; const me = state.get('me'); const accountFetchError = ((state.getIn(['accounts', -1, 'username']) || '').toLowerCase() === username.toLowerCase()); + const features = getFeatures(state.get('instance')); let accountId = -1; if (accountFetchError) { @@ -40,7 +42,7 @@ const mapStateToProps = (state, { params, withReplies = false }) => { const diffCount = getFollowDifference(state, accountId, 'followers'); const isBlocked = state.getIn(['relationships', accountId, 'blocked_by'], false); - const unavailable = (me === accountId) ? false : isBlocked; + const unavailable = (me === accountId) ? false : (isBlocked && !features.blockersVisible); return { accountId, diff --git a/app/soapbox/features/following/index.js b/app/soapbox/features/following/index.js index da1a0beb9..b9b5f7788 100644 --- a/app/soapbox/features/following/index.js +++ b/app/soapbox/features/following/index.js @@ -9,6 +9,7 @@ import { connect } from 'react-redux'; import MissingIndicator from 'soapbox/components/missing_indicator'; import { findAccountByUsername } from 'soapbox/selectors'; import { getFollowDifference } from 'soapbox/utils/accounts'; +import { getFeatures } from 'soapbox/utils/features'; import { fetchAccount, @@ -29,6 +30,7 @@ const mapStateToProps = (state, { params, withReplies = false }) => { const username = params.username || ''; const me = state.get('me'); const accountFetchError = ((state.getIn(['accounts', -1, 'username']) || '').toLowerCase() === username.toLowerCase()); + const features = getFeatures(state.get('instance')); let accountId = -1; if (accountFetchError) { @@ -40,7 +42,7 @@ const mapStateToProps = (state, { params, withReplies = false }) => { const diffCount = getFollowDifference(state, accountId, 'following'); const isBlocked = state.getIn(['relationships', accountId, 'blocked_by'], false); - const unavailable = (me === accountId) ? false : isBlocked; + const unavailable = (me === accountId) ? false : (isBlocked && !features.blockersVisible); return { accountId, diff --git a/app/soapbox/utils/features.js b/app/soapbox/utils/features.js index cd9df9c20..36aba0d6b 100644 --- a/app/soapbox/utils/features.js +++ b/app/soapbox/utils/features.js @@ -32,6 +32,7 @@ export const getFeatures = createSelector([ v.software === MASTODON && gte(v.compatVersion, '3.4.0'), features.includes('v2_suggestions'), ]), + blockersVisible: features.includes('blockers_visible'), trends: v.software === MASTODON && gte(v.compatVersion, '3.0.0'), mediaV2: any([ v.software === MASTODON && gte(v.compatVersion, '3.1.3'),