diff --git a/.rubocop_todo.yml b/.rubocop_todo.yml index 7cbef74e3b..68f1d86944 100644 --- a/.rubocop_todo.yml +++ b/.rubocop_todo.yml @@ -1,6 +1,6 @@ # This configuration was generated by # `rubocop --auto-gen-config --auto-gen-only-exclude --no-offense-counts --no-auto-gen-timestamp` -# using RuboCop version 1.75.7. +# using RuboCop version 1.75.8. # The point is for the user to remove these configuration records # one by one as the offenses are removed from the code base. # Note that changes in the inspected code, or installation of new @@ -35,13 +35,9 @@ Rails/OutputSafety: # Configuration parameters: AllowedVars. Style/FetchEnvVar: Exclude: - - 'config/environments/production.rb' - 'config/initializers/2_limited_federation_mode.rb' - 'config/initializers/3_omniauth.rb' - - 'config/initializers/cache_buster.rb' - - 'config/initializers/devise.rb' - 'config/initializers/paperclip.rb' - - 'config/initializers/vapid.rb' - 'lib/tasks/repo.rake' # This cop supports safe autocorrection (--autocorrect). diff --git a/Gemfile b/Gemfile index c4b57eef79..58b152579b 100644 --- a/Gemfile +++ b/Gemfile @@ -74,7 +74,7 @@ gem 'premailer-rails' gem 'public_suffix', '~> 6.0' gem 'pundit', '~> 2.3' gem 'rack-attack', '~> 6.6' -gem 'rack-cors', '~> 2.0', require: 'rack/cors' +gem 'rack-cors', require: 'rack/cors' gem 'rails-i18n', '~> 8.0' gem 'redcarpet', '~> 3.6' gem 'redis', '~> 4.5', require: ['redis', 'redis/connection/hiredis'] @@ -201,7 +201,7 @@ group :development, :test do gem 'faker', '~> 3.2' # Generate factory objects - gem 'fabrication', '~> 2.30' + gem 'fabrication' # Profiling tools gem 'memory_profiler', require: false diff --git a/Gemfile.lock b/Gemfile.lock index a635602bb0..53200e89b0 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -223,7 +223,7 @@ GEM tzinfo excon (1.2.5) logger - fabrication (2.31.0) + fabrication (3.0.0) faker (3.5.1) i18n (>= 1.8.11, < 2) faraday (2.13.1) @@ -455,7 +455,7 @@ GEM nokogiri (1.18.8) mini_portile2 (~> 2.8.2) racc (~> 1.4) - oj (3.16.10) + oj (3.16.11) bigdecimal (>= 3.0) ostruct (>= 0.2) omniauth (2.1.3) @@ -636,8 +636,9 @@ GEM rack (3.1.15) rack-attack (6.7.0) rack (>= 1.0, < 4) - rack-cors (2.0.2) - rack (>= 2.0.0) + rack-cors (3.0.0) + logger + rack (>= 3.0.14) rack-oauth2 (2.2.1) activesupport attr_required @@ -972,7 +973,7 @@ DEPENDENCIES doorkeeper (~> 5.6) dotenv email_spec - fabrication (~> 2.30) + fabrication faker (~> 3.2) faraday-httpclient fast_blank (~> 1.0) @@ -1046,7 +1047,7 @@ DEPENDENCIES puma (~> 6.3) pundit (~> 2.3) rack-attack (~> 6.6) - rack-cors (~> 2.0) + rack-cors rack-test (~> 2.1) rails (~> 8.0) rails-i18n (~> 8.0) diff --git a/app/javascript/mastodon/components/hover_card_account.tsx b/app/javascript/mastodon/components/hover_card_account.tsx index 12b74823b5..afe82a6013 100644 --- a/app/javascript/mastodon/components/hover_card_account.tsx +++ b/app/javascript/mastodon/components/hover_card_account.tsx @@ -45,6 +45,19 @@ export const HoverCardAccount = forwardRef< const { familiarFollowers } = useFetchFamiliarFollowers({ accountId }); + const relationship = useAppSelector((state) => + accountId ? state.relationships.get(accountId) : undefined, + ); + const isMutual = relationship?.followed_by && relationship.following; + const isFollower = relationship?.followed_by; + const hasRelationshipLoaded = !!relationship; + + const shouldDisplayFamiliarFollowers = + familiarFollowers.length > 0 && + hasRelationshipLoaded && + !isMutual && + !isFollower; + return (
- {familiarFollowers.length > 0 && ( + {shouldDisplayFamiliarFollowers && ( <> ·
@@ -101,6 +114,22 @@ export const HoverCardAccount = forwardRef<
)} + {(isMutual || isFollower) && ( + <> + · + {isMutual ? ( + + ) : ( + + )} + + )}
diff --git a/app/javascript/mastodon/features/account_timeline/components/account_header.tsx b/app/javascript/mastodon/features/account_timeline/components/account_header.tsx index 576052ae71..ff70fd0055 100644 --- a/app/javascript/mastodon/features/account_timeline/components/account_header.tsx +++ b/app/javascript/mastodon/features/account_timeline/components/account_header.tsx @@ -873,7 +873,7 @@ export const AccountHeader: React.FC<{ >