From 7c27ccb8d8fda060f3c5b234f7c81fc29b5fc915 Mon Sep 17 00:00:00 2001 From: David Sterry Date: Sun, 27 Jun 2021 13:31:28 -0700 Subject: Fix #16407 (#16432) --- app/javascript/mastodon/features/ui/components/link_footer.js | 4 ++-- app/javascript/mastodon/initial_state.js | 1 + app/serializers/initial_state_serializer.rb | 1 + app/views/layouts/public.html.haml | 3 ++- 4 files changed, 6 insertions(+), 3 deletions(-) (limited to 'app') diff --git a/app/javascript/mastodon/features/ui/components/link_footer.js b/app/javascript/mastodon/features/ui/components/link_footer.js index 3c4cff9f9..43c03a0e7 100644 --- a/app/javascript/mastodon/features/ui/components/link_footer.js +++ b/app/javascript/mastodon/features/ui/components/link_footer.js @@ -3,7 +3,7 @@ import React from 'react'; import PropTypes from 'prop-types'; import { FormattedMessage, defineMessages, injectIntl } from 'react-intl'; import { Link } from 'react-router-dom'; -import { invitesEnabled, version, repository, source_url } from 'mastodon/initial_state'; +import { invitesEnabled, limitedFederationMode, version, repository, source_url } from 'mastodon/initial_state'; import { logOut } from 'mastodon/utils/log_out'; import { openModal } from 'mastodon/actions/modal'; @@ -50,7 +50,7 @@ class LinkFooter extends React.PureComponent { {invitesEnabled &&
  • ·
  • } {withHotkeys &&
  • ·
  • }
  • ·
  • -
  • ·
  • + {!limitedFederationMode &&
  • ·
  • }
  • ·
  • ·
  • ·
  • diff --git a/app/javascript/mastodon/initial_state.js b/app/javascript/mastodon/initial_state.js index 80d43907d..1389a3c3d 100644 --- a/app/javascript/mastodon/initial_state.js +++ b/app/javascript/mastodon/initial_state.js @@ -13,6 +13,7 @@ export const deleteModal = getMeta('delete_modal'); export const me = getMeta('me'); export const searchEnabled = getMeta('search_enabled'); export const invitesEnabled = getMeta('invites_enabled'); +export const limitedFederationMode = getMeta('limited_federation_mode'); export const repository = getMeta('repository'); export const source_url = getMeta('source_url'); export const version = getMeta('version'); diff --git a/app/serializers/initial_state_serializer.rb b/app/serializers/initial_state_serializer.rb index 70263e0c5..b3b913946 100644 --- a/app/serializers/initial_state_serializer.rb +++ b/app/serializers/initial_state_serializer.rb @@ -19,6 +19,7 @@ class InitialStateSerializer < ActiveModel::Serializer source_url: Mastodon::Version.source_url, version: Mastodon::Version.to_s, invites_enabled: Setting.min_invite_role == 'user', + limited_federation_mode: Rails.configuration.x.whitelist_mode, mascot: instance_presenter.mascot&.file&.url, profile_directory: Setting.profile_directory, trends: Setting.trends, diff --git a/app/views/layouts/public.html.haml b/app/views/layouts/public.html.haml index e63cf0848..bdb8a3a8e 100644 --- a/app/views/layouts/public.html.haml +++ b/app/views/layouts/public.html.haml @@ -46,7 +46,8 @@ .column-3 %h4= site_hostname %ul - %li= link_to t('about.about_this'), about_more_path + - unless whitelist_mode? + %li= link_to t('about.about_this'), about_more_path %li= "v#{Mastodon::Version.to_s}" .column-4 %h4= t 'footer.more' -- cgit From ba8f4535e3abfbd2f4dac95572877d976b65f0dd Mon Sep 17 00:00:00 2001 From: David Sterry Date: Sun, 27 Jun 2021 13:31:28 -0700 Subject: [Glitch] Hide /about/more footer link in limited federation mode Port 7c27ccb8d8fda060f3c5b234f7c81fc29b5fc915 to glitch-soc Signed-off-by: Claire --- app/javascript/flavours/glitch/features/ui/components/link_footer.js | 4 ++-- app/javascript/flavours/glitch/util/initial_state.js | 1 + 2 files changed, 3 insertions(+), 2 deletions(-) (limited to 'app') diff --git a/app/javascript/flavours/glitch/features/ui/components/link_footer.js b/app/javascript/flavours/glitch/features/ui/components/link_footer.js index 4d7fc36c2..40ef506cc 100644 --- a/app/javascript/flavours/glitch/features/ui/components/link_footer.js +++ b/app/javascript/flavours/glitch/features/ui/components/link_footer.js @@ -3,7 +3,7 @@ import React from 'react'; import PropTypes from 'prop-types'; import { FormattedMessage, defineMessages, injectIntl } from 'react-intl'; import { Link } from 'react-router-dom'; -import { invitesEnabled, version, repository, source_url } from 'flavours/glitch/util/initial_state'; +import { invitesEnabled, version, limitedFederationMode, repository, source_url } from 'flavours/glitch/util/initial_state'; import { signOutLink, securityLink } from 'flavours/glitch/util/backend_links'; import { logOut } from 'flavours/glitch/util/log_out'; import { openModal } from 'flavours/glitch/actions/modal'; @@ -47,7 +47,7 @@ class LinkFooter extends React.PureComponent {
      {invitesEnabled &&
    • ·
    • } {!!securityLink &&
    • ·
    • } -
    • ·
    • + {!limitedFederationMode &&
    • ·
    • }
    • ·
    • ·
    • ·
    • diff --git a/app/javascript/flavours/glitch/util/initial_state.js b/app/javascript/flavours/glitch/util/initial_state.js index 911468e6f..370d982d2 100644 --- a/app/javascript/flavours/glitch/util/initial_state.js +++ b/app/javascript/flavours/glitch/util/initial_state.js @@ -24,6 +24,7 @@ export const searchEnabled = getMeta('search_enabled'); export const maxChars = (initialState && initialState.max_toot_chars) || 500; export const pollLimits = (initialState && initialState.poll_limits); export const invitesEnabled = getMeta('invites_enabled'); +export const limitedFederationMode = getMeta('limited_federation_mode'); export const version = getMeta('version'); export const mascot = getMeta('mascot'); export const profile_directory = getMeta('profile_directory'); -- cgit