Merge branch 'block-feature' into 'main'

Feature-gate blocks

See merge request soapbox-pub/soapbox!3015
Alex Gleason 2024-05-02 20:38:36 +00:00
commit 600aefaee5
4 zmienionych plików z 20 dodań i 8 usunięć

Wyświetl plik

@ -266,12 +266,14 @@ const SidebarMenu: React.FC = (): JSX.Element | null => {
<Divider />
<SidebarLink
to='/blocks'
icon={require('@tabler/icons/outline/ban.svg')}
text={intl.formatMessage(messages.blocks)}
onClick={onClose}
/>
{features.blocks && (
<SidebarLink
to='/blocks'
icon={require('@tabler/icons/outline/ban.svg')}
text={intl.formatMessage(messages.blocks)}
onClick={onClose}
/>
)}
<SidebarLink
to='/mutes'

Wyświetl plik

@ -43,7 +43,9 @@ const LinkFooter: React.FC = (): JSX.Element => {
{features.profileDirectory && (
<FooterLink to='/directory'><FormattedMessage id='navigation_bar.profile_directory' defaultMessage='Profile directory' /></FooterLink>
)}
<FooterLink to='/blocks'><FormattedMessage id='navigation_bar.blocks' defaultMessage='Blocks' /></FooterLink>
{features.blocks && (
<FooterLink to='/blocks'><FormattedMessage id='navigation_bar.blocks' defaultMessage='Blocks' /></FooterLink>
)}
<FooterLink to='/mutes'><FormattedMessage id='navigation_bar.mutes' defaultMessage='Mutes' /></FooterLink>
{(features.filters || features.filtersV2) && (
<FooterLink to='/filters'><FormattedMessage id='navigation_bar.filters' defaultMessage='Filters' /></FooterLink>

Wyświetl plik

@ -268,7 +268,7 @@ const SwitchingColumnsArea: React.FC<ISwitchingColumnsArea> = ({ children }) =>
{features.chats && <WrappedRoute path='/chats/:chatId' page={ChatsPage} component={ChatIndex} content={children} />}
<WrappedRoute path='/follow_requests' page={DefaultPage} component={FollowRequests} content={children} />
<WrappedRoute path='/blocks' page={DefaultPage} component={Blocks} 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} />}
<WrappedRoute path='/mutes' page={DefaultPage} component={Mutes} content={children} />
{(features.filters || features.filtersV2) && <WrappedRoute path='/filters/new' page={DefaultPage} component={EditFilter} content={children} />}

Wyświetl plik

@ -251,6 +251,14 @@ const getInstanceFeatures = (instance: Instance) => {
/** Whether people who blocked you are visible through the API. */
blockersVisible: features.includes('blockers_visible'),
/**
* Ability to block users.
* @see POST /api/v1/accounts/:id/block
* @see POST /api/v1/accounts/:id/unblock
* @see GET /api/v1/blocks
*/
blocks: v.software !== DITTO,
/**
* Can group bookmarks in folders.
* @see GET /api/v1/pleroma/bookmark_folders