Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Release: 14.0 #835

Merged
merged 7 commits into from
Sep 10, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -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';
Expand Down Expand Up @@ -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') && <CompactedStatusContainer id={status.get('quote_id')} history={this.props.history} />;

return (
<div style={outerStyle}>
<div ref={this.setRef} className={classNames('detailed-status', { compact })}>
Expand All @@ -349,6 +352,7 @@ class DetailedStatus extends ImmutablePureComponent {

{media}
{hashtagBar}
{quote}
{emojiReactionsBar}
</>
)}
Expand Down
2 changes: 1 addition & 1 deletion app/javascript/mastodon/features/status/index.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
8 changes: 4 additions & 4 deletions app/lib/activitypub/parser/status_parser.rb
Original file line number Diff line number Diff line change
Expand Up @@ -203,17 +203,17 @@ 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
elsif audience_searchable_by.include?('kmyblue:LocalPublic') && @friend
: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
Expand Down
4 changes: 2 additions & 2 deletions app/lib/activitypub/tag_manager.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -273,7 +273,7 @@ def account_searchable_by(account)
when 'limited'
['as:Limited', 'kmyblue:Limited']
else
[]
[account_url(account)]
end
end

Expand Down
2 changes: 1 addition & 1 deletion app/services/activitypub/process_account_service.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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?

Expand Down
10 changes: 5 additions & 5 deletions app/views/application/mailer/_account.html.haml
Original file line number Diff line number Diff line change
Expand Up @@ -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)
4 changes: 2 additions & 2 deletions lib/mastodon/version.rb
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@ def kmyblue_minor

def kmyblue_flag
# 'LTS'
'dev'
# nil
# 'dev'
nil
end

def major
Expand Down
13 changes: 12 additions & 1 deletion spec/lib/activitypub/activity/create_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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 }

Expand Down
2 changes: 1 addition & 1 deletion spec/lib/activitypub/tag_manager_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
8 changes: 8 additions & 0 deletions spec/serializers/activitypub/note_serializer_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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) }

Expand Down
10 changes: 9 additions & 1 deletion spec/services/activitypub/process_account_service_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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'
Expand All @@ -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 }

Expand Down
Loading