diff --git a/app/javascript/mastodon/features/status/components/detailed_status.jsx b/app/javascript/mastodon/features/status/components/detailed_status.jsx index 5ab0b9472f119a..06d86ef4fc1150 100644 --- a/app/javascript/mastodon/features/status/components/detailed_status.jsx +++ b/app/javascript/mastodon/features/status/components/detailed_status.jsx @@ -25,6 +25,7 @@ import { DisplayName } from '../../../components/display_name'; import MediaGallery from '../../../components/media_gallery'; import StatusContent from '../../../components/status_content'; import StatusEmojiReactionsBar from '../../../components/status_emoji_reactions_bar'; +import CompactedStatusContainer from '../../../containers/compacted_status_container'; import Audio from '../../audio'; import scheduleIdleTask from '../../ui/util/schedule_idle_task'; import Video from '../../video'; @@ -323,6 +324,8 @@ class DetailedStatus extends ImmutablePureComponent { const {statusContentProps, hashtagBar} = getHashtagBarForStatus(status); const expanded = !status.get('hidden') || status.get('spoiler_text').length === 0; + const quote = !this.props.muted && status.get('quote_id') && ; + return (
@@ -349,6 +352,7 @@ class DetailedStatus extends ImmutablePureComponent { {media} {hashtagBar} + {quote} {emojiReactionsBar} )} diff --git a/app/javascript/mastodon/features/status/index.jsx b/app/javascript/mastodon/features/status/index.jsx index 6e190b0e7c471b..8c43c5c8cf179d 100644 --- a/app/javascript/mastodon/features/status/index.jsx +++ b/app/javascript/mastodon/features/status/index.jsx @@ -156,7 +156,7 @@ const makeMapStateToProps = () => { if (status) { ancestorsIds = getAncestorsIds(state, { id: status.get('in_reply_to_id') }); descendantsIds = getDescendantsIds(state, { id: status.get('id') }); - referenceIds = getReferenceIds(state, { id: status.get('id') }); + referenceIds = getReferenceIds(state, { id: status.get('id') }).filter((id) => id !== status.get('quote_id')); } return { diff --git a/app/lib/activitypub/parser/status_parser.rb b/app/lib/activitypub/parser/status_parser.rb index a2ae6588741815..cc9788e964ca36 100644 --- a/app/lib/activitypub/parser/status_parser.rb +++ b/app/lib/activitypub/parser/status_parser.rb @@ -203,9 +203,9 @@ def searchability_from_bio end def searchability_from_audience - if audience_searchable_by.nil? - nil - elsif audience_searchable_by.any? { |uri| ActivityPub::TagManager.instance.public_collection?(uri) } + return nil if audience_searchable_by.blank? + + if audience_searchable_by.any? { |uri| ActivityPub::TagManager.instance.public_collection?(uri) } :public elsif audience_searchable_by.include?('kmyblue:Limited') || audience_searchable_by.include?('as:Limited') :limited @@ -213,7 +213,7 @@ def searchability_from_audience :public_unlisted elsif audience_searchable_by.include?(@account.followers_url) :private - else + elsif audience_searchable_by.include?(@account.uri) || audience_searchable_by.include?(@account.url) :direct end end diff --git a/app/lib/activitypub/tag_manager.rb b/app/lib/activitypub/tag_manager.rb index 84e5ea547da365..53f0f0c69372de 100644 --- a/app/lib/activitypub/tag_manager.rb +++ b/app/lib/activitypub/tag_manager.rb @@ -252,7 +252,7 @@ def searchable_by(status) when 'limited' ['as:Limited', 'kmyblue:Limited'] else - [] + [account_url(status.account)] end searchable_by.concat(mentions_uris(status)).compact @@ -273,7 +273,7 @@ def account_searchable_by(account) when 'limited' ['as:Limited', 'kmyblue:Limited'] else - [] + [account_url(account)] end end diff --git a/app/services/activitypub/process_account_service.rb b/app/services/activitypub/process_account_service.rb index 474fad59d531eb..1440e3d8ae6c75 100644 --- a/app/services/activitypub/process_account_service.rb +++ b/app/services/activitypub/process_account_service.rb @@ -282,7 +282,7 @@ def audience_searchable_by end def searchability_from_audience - if audience_searchable_by.nil? + if audience_searchable_by.blank? bio = searchability_from_bio return bio unless bio.nil? diff --git a/app/views/application/mailer/_account.html.haml b/app/views/application/mailer/_account.html.haml index 27493f770dc006..e9577fa90dd8d1 100644 --- a/app/views/application/mailer/_account.html.haml +++ b/app/views/application/mailer/_account.html.haml @@ -20,11 +20,11 @@ %table.email-w-full.email-account-stats-table{ cellspacing: 0, cellpadding: 0, border: 0, role: 'presentation' } %tr %td - %b= account_formatted_stat(account.statuses_count) - %span= t('accounts.posts', count: account.statuses_count) + %b= account.hide_statuses_count? ? '-' : account_formatted_stat(account.public_statuses_count) + %span= t('accounts.posts', count: account.public_statuses_count) %td - %b= account_formatted_stat(account.following_count) + %b= account.hide_following_count? ? '-' : account_formatted_stat(account.public_following_count) %span= t('accounts.following') %td - %b= account_formatted_stat(account.followers_count) - %span= t('accounts.followers', count: account.followers_count) + %b= account.hide_followers_count? ? '-' : account_formatted_stat(account.public_followers_count) + %span= t('accounts.followers', count: account.public_followers_count) diff --git a/lib/mastodon/version.rb b/lib/mastodon/version.rb index 522c092f818a1c..7f7330961f7165 100644 --- a/lib/mastodon/version.rb +++ b/lib/mastodon/version.rb @@ -14,8 +14,8 @@ def kmyblue_minor def kmyblue_flag # 'LTS' - 'dev' - # nil + # 'dev' + nil end def major diff --git a/spec/lib/activitypub/activity/create_spec.rb b/spec/lib/activitypub/activity/create_spec.rb index a84eb887a10078..03793c4475218f 100644 --- a/spec/lib/activitypub/activity/create_spec.rb +++ b/spec/lib/activitypub/activity/create_spec.rb @@ -632,7 +632,7 @@ def activity_for_object(json) end context 'with direct' do - let(:searchable_by) { '' } + let(:searchable_by) { 'https://example.com/actor' } it 'create status' do status = sender.statuses.first @@ -642,6 +642,17 @@ def activity_for_object(json) end end + context 'with empty array' do + let(:searchable_by) { '' } + + it 'create status' do + status = sender.statuses.first + + expect(status).to_not be_nil + expect(status.searchability).to be_nil + end + end + context 'with direct when not specify' do let(:searchable_by) { nil } diff --git a/spec/lib/activitypub/tag_manager_spec.rb b/spec/lib/activitypub/tag_manager_spec.rb index 0d9c23cb5eb0d9..2bc78205420d4f 100644 --- a/spec/lib/activitypub/tag_manager_spec.rb +++ b/spec/lib/activitypub/tag_manager_spec.rb @@ -210,7 +210,7 @@ it 'returns empty array for direct status' do status = Fabricate(:status, searchability: :direct) - expect(subject.searchable_by(status)).to eq [] + expect(subject.searchable_by(status)).to eq ["https://cb6e6126.ngrok.io/users/#{status.account.username}"] end it 'returns as:Limited array for limited status' do diff --git a/spec/serializers/activitypub/note_serializer_spec.rb b/spec/serializers/activitypub/note_serializer_spec.rb index 71e4d3330574e4..f52b2a510416fd 100644 --- a/spec/serializers/activitypub/note_serializer_spec.rb +++ b/spec/serializers/activitypub/note_serializer_spec.rb @@ -81,6 +81,14 @@ end end + context 'when direct searchability' do + let(:searchability) { :direct } + + it 'send as direct searchability' do + expect(subject['searchableBy']).to include "https://cb6e6126.ngrok.io/users/#{account.username}" + end + end + context 'when has a reference' do let(:referred) { Fabricate(:status) } diff --git a/spec/services/activitypub/process_account_service_spec.rb b/spec/services/activitypub/process_account_service_spec.rb index e399daf2a7b200..5febc49e51f8a1 100644 --- a/spec/services/activitypub/process_account_service_spec.rb +++ b/spec/services/activitypub/process_account_service_spec.rb @@ -150,7 +150,7 @@ end context 'when direct' do - let(:searchable_by) { '' } + let(:searchable_by) { 'https://foo.test' } it 'searchability is direct' do expect(subject.searchability).to eq 'direct' @@ -173,6 +173,14 @@ end end + context 'when empty array' do + let(:searchable_by) { '' } + + it 'searchability is direct' do + expect(subject.searchability).to eq 'direct' + end + end + context 'when default value' do let(:searchable_by) { nil }