diff --git a/CHANGELOG.md b/CHANGELOG.md index b9834dcaef..dda3b725af 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -16,6 +16,10 @@ All notable changes to this project will be documented in this file. ### Fixed +- Fix some remote posts getting truncated ([ClearlyClaire](https://github.com/mastodon/mastodon/pull/27307)) +- Fix some cases of infinite scroll code trying to fetch inaccessible posts in a loop ([ClearlyClaire](https://github.com/mastodon/mastodon/pull/27286)) +- Fix `Vary` headers not being set on some redirects ([ClearlyClaire](https://github.com/mastodon/mastodon/pull/27272)) +- Fix mentions being matched in some URL query strings ([mjankowski](https://github.com/mastodon/mastodon/pull/25656)) - Fix unexpected linebreak in version string in the Web UI ([vmstan](https://github.com/mastodon/mastodon/pull/26986)) - Fix double scroll bars in some columns in advanced interface ([ClearlyClaire](https://github.com/mastodon/mastodon/pull/27187)) - Fix boosts of local users being filtered in account timelines ([ClearlyClaire](https://github.com/mastodon/mastodon/pull/27204)) @@ -32,7 +36,7 @@ All notable changes to this project will be documented in this file. - Fix retention dashboard not displaying correct month ([vmstan](https://github.com/mastodon/mastodon/pull/27180)) - Fix tIME chunk not being properly removed from PNG uploads ([TheEssem](https://github.com/mastodon/mastodon/pull/27111)) - Fix division by zero in video in bitrate computation code ([ClearlyClaire](https://github.com/mastodon/mastodon/pull/27129)) -- Fix inefficient queries in “Follows and followers” as well as several admin pages ([ClearlyClaire](https://github.com/mastodon/mastodon/pull/27116)) +- Fix inefficient queries in “Follows and followers” as well as several admin pages ([ClearlyClaire](https://github.com/mastodon/mastodon/pull/27116), [ClearlyClaire](https://github.com/mastodon/mastodon/pull/27306)) - Fix ActiveRecord using two connection pools when no replica is defined ([ClearlyClaire](https://github.com/mastodon/mastodon/pull/27061)) - Fix the search documentation URL in system checks ([renchap](https://github.com/mastodon/mastodon/pull/27036)) diff --git a/app/controllers/api/v1/statuses_controller.rb b/app/controllers/api/v1/statuses_controller.rb index 1df399405a..065ec07613 100644 --- a/app/controllers/api/v1/statuses_controller.rb +++ b/app/controllers/api/v1/statuses_controller.rb @@ -44,7 +44,7 @@ class Api::V1::StatusesController < Api::BaseController ancestors_results = @status.in_reply_to_id.nil? ? [] : @status.ancestors(ancestors_limit, current_account) descendants_results = @status.descendants(descendants_limit, current_account, descendants_depth_limit) - references_results = @status.references + references_results = @status.readable_references(current_account) loaded_ancestors = cache_collection(ancestors_results, Status) loaded_descendants = cache_collection(descendants_results, Status) loaded_references = cache_collection(references_results, Status) diff --git a/app/helpers/kmyblue_capabilities_helper.rb b/app/helpers/kmyblue_capabilities_helper.rb index 5b3b89f9e9..8653a3f9da 100644 --- a/app/helpers/kmyblue_capabilities_helper.rb +++ b/app/helpers/kmyblue_capabilities_helper.rb @@ -18,6 +18,7 @@ module KmyblueCapabilitiesHelper :kmyblue_quote, :kmyblue_searchability_limited, :kmyblue_searchability_public_unlisted, + :kmyblue_circle_history, ] capabilities << :profile_search unless Chewy.enabled? diff --git a/app/models/concerns/status_threading_concern.rb b/app/models/concerns/status_threading_concern.rb index 38d0f393b7..52b397b47d 100644 --- a/app/models/concerns/status_threading_concern.rb +++ b/app/models/concerns/status_threading_concern.rb @@ -11,6 +11,15 @@ module StatusThreadingConcern find_statuses_from_tree_path(descendant_ids(limit, depth), account, promote: true) end + def readable_references(account = nil) + statuses = references.to_a + account_ids = statuses.map(&:account_id).uniq + domains = statuses.filter_map(&:account_domain).uniq + relations = account&.relations_map(account_ids, domains) || {} + statuses.reject! { |status| StatusFilter.new(status, account, relations).filtered? } + statuses + end + def self_replies(limit) account.statuses.where(in_reply_to_id: id, visibility: [:public, :unlisted, :public_unlisted, :login]).reorder(id: :asc).limit(limit) end diff --git a/app/serializers/nodeinfo/serializer.rb b/app/serializers/nodeinfo/serializer.rb index df8bc07611..3555f0bd8d 100644 --- a/app/serializers/nodeinfo/serializer.rb +++ b/app/serializers/nodeinfo/serializer.rb @@ -40,7 +40,7 @@ class NodeInfo::Serializer < ActiveModel::Serializer def metadata { - fedibird_capabilities: fedibird_capabilities, + features: fedibird_capabilities, } end diff --git a/lib/mastodon/version.rb b/lib/mastodon/version.rb index e4839a83d2..57f61bcacf 100644 --- a/lib/mastodon/version.rb +++ b/lib/mastodon/version.rb @@ -5,11 +5,11 @@ module Mastodon module_function def kmyblue_major - 6 + 7 end def kmyblue_minor - 0 + 1 end def kmyblue_flag @@ -21,7 +21,7 @@ module Mastodon end def minor - 3 + 2 end def patch diff --git a/spec/serializers/nodeinfo/serializer_spec.rb b/spec/serializers/nodeinfo/serializer_spec.rb new file mode 100644 index 0000000000..c43b0b569f --- /dev/null +++ b/spec/serializers/nodeinfo/serializer_spec.rb @@ -0,0 +1,32 @@ +# frozen_string_literal: true + +require 'rails_helper' + +describe NodeInfo::Serializer do # rubocop:disable RSpec/FilePath + let(:serialization) do + JSON.parse( + ActiveModelSerializers::SerializableResource.new( + record, adapter: NodeInfo::Adapter, serializer: described_class, root: 'nodeinfo' + ).to_json + ) + end + let(:record) { {} } + + describe 'nodeinfo version' do + it 'returns 2.0' do + expect(serialization['version']).to eq '2.0' + end + end + + describe 'mastodon version' do + it 'contains kmyblue' do + expect(serialization['software']['version'].include?('kmyblue')).to be true + end + end + + describe 'metadata' do + it 'returns features' do + expect(serialization['metadata']['features']).to include 'emoji_reaction' + end + end +end diff --git a/spec/serializers/rest/instance_serializer_spec.rb b/spec/serializers/rest/instance_serializer_spec.rb index 15a5de18dd..a9a3259aa8 100644 --- a/spec/serializers/rest/instance_serializer_spec.rb +++ b/spec/serializers/rest/instance_serializer_spec.rb @@ -17,4 +17,10 @@ describe REST::InstanceSerializer do expect(serialization['usage']).to eq({ 'users' => { 'active_month' => 0 } }) end end + + describe 'fedibird_capabilities' do + it 'returns fedibird_capabilities' do + expect(serialization['fedibird_capabilities']).to include 'emoji_reaction' + end + end end