Merge branch 'gate-domain-blocks' into 'main'

Feature-gate domain blocks

See merge request soapbox-pub/soapbox!3040
environments/review-main-yi2y9f/deployments/4648
Alex Gleason 4 months ago
commit cd16b776bf

@ -464,7 +464,7 @@ const Header: React.FC<IHeader> = ({ account }) => {
});
}
if (!account.local) {
if (!account.local && features.domainBlocks) {
const domain = account.fqn.split('@')[1];
menu.push(null);

@ -53,7 +53,7 @@ const LinkFooter: React.FC = (): JSX.Element => {
{features.followedHashtagsList && (
<FooterLink to='/followed_tags'><FormattedMessage id='navigation_bar.followed_tags' defaultMessage='Followed hashtags' /></FooterLink>
)}
{features.federating && (
{features.domainBlocks && (
<FooterLink to='/domain_blocks'><FormattedMessage id='navigation_bar.domain_blocks' defaultMessage='Domain blocks' /></FooterLink>
)}
{account.admin && (

@ -268,7 +268,7 @@ const SwitchingColumnsArea: React.FC<ISwitchingColumnsArea> = ({ children }) =>
<WrappedRoute path='/follow_requests' page={DefaultPage} component={FollowRequests} content={children} />
{features.blocks && <WrappedRoute path='/blocks' page={DefaultPage} component={Blocks} content={children} />}
{features.federating && <WrappedRoute path='/domain_blocks' page={DefaultPage} component={DomainBlocks} content={children} />}
{features.domainBlocks && <WrappedRoute path='/domain_blocks' page={DefaultPage} component={DomainBlocks} content={children} />}
<WrappedRoute path='/mutes' page={DefaultPage} component={Mutes} content={children} />
{(features.filters || features.filtersV2) && <WrappedRoute path='/filters/new' page={DefaultPage} component={EditFilter} content={children} />}
{(features.filters || features.filtersV2) && <WrappedRoute path='/filters/:id' page={DefaultPage} component={EditFilter} content={children} />}

@ -400,6 +400,17 @@ const getInstanceFeatures = (instance: Instance) => {
*/
dislikes: v.software === FRIENDICA && gte(v.version, '2023.3.0'),
/**
* Ability to block users by domain.
* @see GET /api/v1/domain_blocks
* @see POST /api/v1/domain_blocks
* @see DELETE /api/v1/domain_blocks
*/
domainBlocks: federation.enabled && any([
v.software === MASTODON && gte(v.compatVersion, '1.4.0'),
v.software === PLEROMA,
]),
/**
* Allow to register on a given domain
* @see GET /api/v1/pleroma/admin/domains

Loading…
Cancel
Save