commit
8fd9f6fb55
11 changed files with 49 additions and 18 deletions
|
@ -25,6 +25,7 @@ import { DisplayName } from '../../../components/display_name';
|
||||||
import MediaGallery from '../../../components/media_gallery';
|
import MediaGallery from '../../../components/media_gallery';
|
||||||
import StatusContent from '../../../components/status_content';
|
import StatusContent from '../../../components/status_content';
|
||||||
import StatusEmojiReactionsBar from '../../../components/status_emoji_reactions_bar';
|
import StatusEmojiReactionsBar from '../../../components/status_emoji_reactions_bar';
|
||||||
|
import CompactedStatusContainer from '../../../containers/compacted_status_container';
|
||||||
import Audio from '../../audio';
|
import Audio from '../../audio';
|
||||||
import scheduleIdleTask from '../../ui/util/schedule_idle_task';
|
import scheduleIdleTask from '../../ui/util/schedule_idle_task';
|
||||||
import Video from '../../video';
|
import Video from '../../video';
|
||||||
|
@ -323,6 +324,8 @@ class DetailedStatus extends ImmutablePureComponent {
|
||||||
const {statusContentProps, hashtagBar} = getHashtagBarForStatus(status);
|
const {statusContentProps, hashtagBar} = getHashtagBarForStatus(status);
|
||||||
const expanded = !status.get('hidden') || status.get('spoiler_text').length === 0;
|
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 (
|
return (
|
||||||
<div style={outerStyle}>
|
<div style={outerStyle}>
|
||||||
<div ref={this.setRef} className={classNames('detailed-status', { compact })}>
|
<div ref={this.setRef} className={classNames('detailed-status', { compact })}>
|
||||||
|
@ -349,6 +352,7 @@ class DetailedStatus extends ImmutablePureComponent {
|
||||||
|
|
||||||
{media}
|
{media}
|
||||||
{hashtagBar}
|
{hashtagBar}
|
||||||
|
{quote}
|
||||||
{emojiReactionsBar}
|
{emojiReactionsBar}
|
||||||
</>
|
</>
|
||||||
)}
|
)}
|
||||||
|
|
|
@ -156,7 +156,7 @@ const makeMapStateToProps = () => {
|
||||||
if (status) {
|
if (status) {
|
||||||
ancestorsIds = getAncestorsIds(state, { id: status.get('in_reply_to_id') });
|
ancestorsIds = getAncestorsIds(state, { id: status.get('in_reply_to_id') });
|
||||||
descendantsIds = getDescendantsIds(state, { id: status.get('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 {
|
return {
|
||||||
|
|
|
@ -203,9 +203,9 @@ class ActivityPub::Parser::StatusParser
|
||||||
end
|
end
|
||||||
|
|
||||||
def searchability_from_audience
|
def searchability_from_audience
|
||||||
if audience_searchable_by.nil?
|
return nil if audience_searchable_by.blank?
|
||||||
nil
|
|
||||||
elsif audience_searchable_by.any? { |uri| ActivityPub::TagManager.instance.public_collection?(uri) }
|
if audience_searchable_by.any? { |uri| ActivityPub::TagManager.instance.public_collection?(uri) }
|
||||||
:public
|
:public
|
||||||
elsif audience_searchable_by.include?('kmyblue:Limited') || audience_searchable_by.include?('as:Limited')
|
elsif audience_searchable_by.include?('kmyblue:Limited') || audience_searchable_by.include?('as:Limited')
|
||||||
:limited
|
:limited
|
||||||
|
@ -213,7 +213,7 @@ class ActivityPub::Parser::StatusParser
|
||||||
:public_unlisted
|
:public_unlisted
|
||||||
elsif audience_searchable_by.include?(@account.followers_url)
|
elsif audience_searchable_by.include?(@account.followers_url)
|
||||||
:private
|
:private
|
||||||
else
|
elsif audience_searchable_by.include?(@account.uri) || audience_searchable_by.include?(@account.url)
|
||||||
:direct
|
:direct
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
|
@ -252,7 +252,7 @@ class ActivityPub::TagManager
|
||||||
when 'limited'
|
when 'limited'
|
||||||
['as:Limited', 'kmyblue:Limited']
|
['as:Limited', 'kmyblue:Limited']
|
||||||
else
|
else
|
||||||
[]
|
[account_url(status.account)]
|
||||||
end
|
end
|
||||||
|
|
||||||
searchable_by.concat(mentions_uris(status)).compact
|
searchable_by.concat(mentions_uris(status)).compact
|
||||||
|
@ -273,7 +273,7 @@ class ActivityPub::TagManager
|
||||||
when 'limited'
|
when 'limited'
|
||||||
['as:Limited', 'kmyblue:Limited']
|
['as:Limited', 'kmyblue:Limited']
|
||||||
else
|
else
|
||||||
[]
|
[account_url(account)]
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
|
@ -282,7 +282,7 @@ class ActivityPub::ProcessAccountService < BaseService
|
||||||
end
|
end
|
||||||
|
|
||||||
def searchability_from_audience
|
def searchability_from_audience
|
||||||
if audience_searchable_by.nil?
|
if audience_searchable_by.blank?
|
||||||
bio = searchability_from_bio
|
bio = searchability_from_bio
|
||||||
return bio unless bio.nil?
|
return bio unless bio.nil?
|
||||||
|
|
||||||
|
|
|
@ -20,11 +20,11 @@
|
||||||
%table.email-w-full.email-account-stats-table{ cellspacing: 0, cellpadding: 0, border: 0, role: 'presentation' }
|
%table.email-w-full.email-account-stats-table{ cellspacing: 0, cellpadding: 0, border: 0, role: 'presentation' }
|
||||||
%tr
|
%tr
|
||||||
%td
|
%td
|
||||||
%b= account_formatted_stat(account.statuses_count)
|
%b= account.hide_statuses_count? ? '-' : account_formatted_stat(account.public_statuses_count)
|
||||||
%span= t('accounts.posts', count: account.statuses_count)
|
%span= t('accounts.posts', count: account.public_statuses_count)
|
||||||
%td
|
%td
|
||||||
%b= account_formatted_stat(account.following_count)
|
%b= account.hide_following_count? ? '-' : account_formatted_stat(account.public_following_count)
|
||||||
%span= t('accounts.following')
|
%span= t('accounts.following')
|
||||||
%td
|
%td
|
||||||
%b= account_formatted_stat(account.followers_count)
|
%b= account.hide_followers_count? ? '-' : account_formatted_stat(account.public_followers_count)
|
||||||
%span= t('accounts.followers', count: account.followers_count)
|
%span= t('accounts.followers', count: account.public_followers_count)
|
||||||
|
|
|
@ -14,8 +14,8 @@ module Mastodon
|
||||||
|
|
||||||
def kmyblue_flag
|
def kmyblue_flag
|
||||||
# 'LTS'
|
# 'LTS'
|
||||||
'dev'
|
# 'dev'
|
||||||
# nil
|
nil
|
||||||
end
|
end
|
||||||
|
|
||||||
def major
|
def major
|
||||||
|
|
|
@ -632,7 +632,7 @@ RSpec.describe ActivityPub::Activity::Create do
|
||||||
end
|
end
|
||||||
|
|
||||||
context 'with direct' do
|
context 'with direct' do
|
||||||
let(:searchable_by) { '' }
|
let(:searchable_by) { 'https://example.com/actor' }
|
||||||
|
|
||||||
it 'create status' do
|
it 'create status' do
|
||||||
status = sender.statuses.first
|
status = sender.statuses.first
|
||||||
|
@ -642,6 +642,17 @@ RSpec.describe ActivityPub::Activity::Create do
|
||||||
end
|
end
|
||||||
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
|
context 'with direct when not specify' do
|
||||||
let(:searchable_by) { nil }
|
let(:searchable_by) { nil }
|
||||||
|
|
||||||
|
|
|
@ -210,7 +210,7 @@ RSpec.describe ActivityPub::TagManager do
|
||||||
|
|
||||||
it 'returns empty array for direct status' do
|
it 'returns empty array for direct status' do
|
||||||
status = Fabricate(:status, searchability: :direct)
|
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
|
end
|
||||||
|
|
||||||
it 'returns as:Limited array for limited status' do
|
it 'returns as:Limited array for limited status' do
|
||||||
|
|
|
@ -81,6 +81,14 @@ describe ActivityPub::NoteSerializer do
|
||||||
end
|
end
|
||||||
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
|
context 'when has a reference' do
|
||||||
let(:referred) { Fabricate(:status) }
|
let(:referred) { Fabricate(:status) }
|
||||||
|
|
||||||
|
|
|
@ -150,7 +150,7 @@ RSpec.describe ActivityPub::ProcessAccountService do
|
||||||
end
|
end
|
||||||
|
|
||||||
context 'when direct' do
|
context 'when direct' do
|
||||||
let(:searchable_by) { '' }
|
let(:searchable_by) { 'https://foo.test' }
|
||||||
|
|
||||||
it 'searchability is direct' do
|
it 'searchability is direct' do
|
||||||
expect(subject.searchability).to eq 'direct'
|
expect(subject.searchability).to eq 'direct'
|
||||||
|
@ -173,6 +173,14 @@ RSpec.describe ActivityPub::ProcessAccountService do
|
||||||
end
|
end
|
||||||
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
|
context 'when default value' do
|
||||||
let(:searchable_by) { nil }
|
let(:searchable_by) { nil }
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue