From 25f132365f005d76bf9b3e38a55585f15d2a37fc Mon Sep 17 00:00:00 2001 From: KMY Date: Fri, 6 Sep 2024 07:28:29 +0900 Subject: [PATCH 1/5] Bump version to 14.0 --- lib/mastodon/version.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) 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 From 14f2ffa35f9aa0352e495196beeb63f1b710f2cf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?KMY=EF=BC=88=E9=9B=AA=E3=81=82=E3=81=99=E3=81=8B=EF=BC=89?= Date: Sat, 7 Sep 2024 18:13:01 +0900 Subject: [PATCH 2/5] =?UTF-8?q?Change:=20#831=20=E6=8A=95=E7=A8=BF?= =?UTF-8?q?=E8=A9=B3=E7=B4=B0=E7=94=BB=E9=9D=A2=E3=81=AB=E3=81=8A=E3=81=91?= =?UTF-8?q?=E3=82=8B=E5=BC=95=E7=94=A8=E3=81=AE=E8=A1=A8=E7=A4=BA=20(#839)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../mastodon/features/status/components/detailed_status.jsx | 4 ++++ app/javascript/mastodon/features/status/index.jsx | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) 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 { From 1db6f55ba94a9f3715d22e83ae3dc28bb5a1d32b Mon Sep 17 00:00:00 2001 From: KMY Date: Mon, 9 Sep 2024 08:36:38 +0900 Subject: [PATCH 3/5] =?UTF-8?q?Fix:=20=E3=83=97=E3=83=AD=E3=83=95=E3=82=A3?= =?UTF-8?q?=E3=83=BC=E3=83=AB=E8=A8=AD=E5=AE=9A=E3=81=A7=E3=83=95=E3=82=A9?= =?UTF-8?q?=E3=83=AD=E3=83=BC=E6=95=B0=E3=81=AA=E3=81=A9=E3=81=AE=E6=95=B0?= =?UTF-8?q?=E5=AD=97=E3=82=92=E9=9A=A0=E3=81=97=E3=81=A6=E3=81=84=E3=81=A6?= =?UTF-8?q?=E3=82=82=E3=80=81=E8=AA=B0=E3=81=8B=E3=82=92=E3=83=95=E3=82=A9?= =?UTF-8?q?=E3=83=AD=E3=83=BC=E3=81=97=E3=81=9F=E6=99=82=E3=81=AB=E3=83=95?= =?UTF-8?q?=E3=82=A9=E3=83=AD=E3=83=BC=E7=9B=B8=E6=89=8B=E3=81=AB=E3=83=A1?= =?UTF-8?q?=E3=83=BC=E3=83=AB=E3=81=A7=E6=95=B0=E5=AD=97=E3=81=8C=E9=80=9A?= =?UTF-8?q?=E7=9F=A5=E3=81=95=E3=82=8C=E3=82=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/views/application/mailer/_account.html.haml | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) 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) From 099182e073025229ec9a55cc2733116ec28ce7bf Mon Sep 17 00:00:00 2001 From: KMY Date: Tue, 10 Sep 2024 06:51:26 +0900 Subject: [PATCH 4/5] =?UTF-8?q?Fix:=20LD=20Signatures=E3=81=A7=E7=BD=B2?= =?UTF-8?q?=E5=90=8D=E3=81=95=E3=82=8C=E3=81=9F=E6=8A=95=E7=A8=BF=E3=81=AE?= =?UTF-8?q?=E6=A4=9C=E7=B4=A2=E8=A8=B1=E5=8F=AF=EF=BC=88=E6=A4=9C=E7=B4=A2?= =?UTF-8?q?=E7=AF=84=E5=9B=B2=EF=BC=89=E3=81=8C=E6=94=B9=E7=AB=84=E3=81=A7?= =?UTF-8?q?=E3=81=8D=E3=82=8B=E5=95=8F=E9=A1=8C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/lib/activitypub/parser/status_parser.rb | 8 ++++---- app/lib/activitypub/tag_manager.rb | 2 +- app/services/activitypub/process_account_service.rb | 2 +- spec/lib/activitypub/activity/create_spec.rb | 13 ++++++++++++- spec/lib/activitypub/tag_manager_spec.rb | 2 +- .../serializers/activitypub/note_serializer_spec.rb | 8 ++++++++ .../activitypub/process_account_service_spec.rb | 10 +++++++++- 7 files changed, 36 insertions(+), 9 deletions(-) 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..6fe5db37693cc7 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 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/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 } From 9b9458f4367ff6d27d4349cfc69e6e819edf6740 Mon Sep 17 00:00:00 2001 From: KMY Date: Tue, 10 Sep 2024 07:25:17 +0900 Subject: [PATCH 5/5] Fix account searchability --- app/lib/activitypub/tag_manager.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/lib/activitypub/tag_manager.rb b/app/lib/activitypub/tag_manager.rb index 6fe5db37693cc7..53f0f0c69372de 100644 --- a/app/lib/activitypub/tag_manager.rb +++ b/app/lib/activitypub/tag_manager.rb @@ -273,7 +273,7 @@ def account_searchable_by(account) when 'limited' ['as:Limited', 'kmyblue:Limited'] else - [] + [account_url(account)] end end