Unlisted/searchability=public posts hashtag search
This commit is contained in:
parent
ca66c47649
commit
222a31c37c
5 changed files with 17 additions and 2 deletions
|
@ -11,7 +11,7 @@ import Warning from '../components/warning';
|
|||
|
||||
const mapStateToProps = state => ({
|
||||
needsLockWarning: state.getIn(['compose', 'privacy']) === 'private' && !state.getIn(['accounts', me, 'locked']),
|
||||
hashtagWarning: ['public', 'public_unlisted', 'login'].indexOf(state.getIn(['compose', 'privacy'])) < 0 && HASHTAG_PATTERN_REGEX.test(state.getIn(['compose', 'text'])),
|
||||
hashtagWarning: ['public', 'public_unlisted', 'login'].indexOf(state.getIn(['compose', 'privacy'])) < 0 && state.getIn(['compose', 'searchability']) !== 'public' && HASHTAG_PATTERN_REGEX.test(state.getIn(['compose', 'text'])),
|
||||
directMessageWarning: state.getIn(['compose', 'privacy']) === 'direct',
|
||||
searchabilityWarning: state.getIn(['compose', 'searchability']) === 'limited',
|
||||
});
|
||||
|
|
|
@ -70,6 +70,10 @@ class PublicFeed
|
|||
Status.with_public_visibility.joins(:account).merge(Account.without_suspended.without_silenced)
|
||||
end
|
||||
|
||||
def public_search_scope
|
||||
Status.with_public_search_visibility.joins(:account).merge(Account.without_suspended.without_silenced)
|
||||
end
|
||||
|
||||
def local_only_scope
|
||||
Status.local
|
||||
end
|
||||
|
|
|
@ -103,6 +103,7 @@ class Status < ApplicationRecord
|
|||
scope :without_replies, -> { where('statuses.reply = FALSE OR statuses.in_reply_to_account_id = statuses.account_id') }
|
||||
scope :without_reblogs, -> { where(statuses: { reblog_of_id: nil }) }
|
||||
scope :with_public_visibility, -> { where(visibility: [:public, :public_unlisted, :login]) }
|
||||
scope :with_public_search_visibility, -> { merge(where(visibility: [:public, :public_unlisted, :login]).or(Status.where(searchability: :public))) }
|
||||
scope :with_global_timeline_visibility, -> { where(visibility: [:public, :login]) }
|
||||
scope :tagged_with, ->(tag_ids) { joins(:statuses_tags).where(statuses_tags: { tag_id: tag_ids }) }
|
||||
scope :excluding_silenced_accounts, -> { left_outer_joins(:account).where(accounts: { silenced_at: nil }) }
|
||||
|
|
|
@ -23,7 +23,7 @@ class TagFeed < PublicFeed
|
|||
# @param [Integer] min_id
|
||||
# @return [Array<Status>]
|
||||
def get(limit, max_id = nil, since_id = nil, min_id = nil)
|
||||
scope = public_scope
|
||||
scope = public_search_scope
|
||||
|
||||
scope.merge!(tagged_with_any_scope)
|
||||
scope.merge!(tagged_with_all_scope)
|
||||
|
|
|
@ -23,6 +23,8 @@ class FanOutOnWriteService < BaseService
|
|||
elsif broadcastable_unlisted?
|
||||
fan_out_to_public_recipients!
|
||||
fan_out_to_public_unlisted_streams!
|
||||
elsif broadcastable_unlisted2?
|
||||
fan_out_to_unlisted_streams!
|
||||
end
|
||||
end
|
||||
|
||||
|
@ -73,6 +75,10 @@ class FanOutOnWriteService < BaseService
|
|||
broadcast_to_public_unlisted_streams!
|
||||
end
|
||||
|
||||
def fan_out_to_unlisted_streams!
|
||||
broadcast_to_hashtag_streams!
|
||||
end
|
||||
|
||||
def deliver_to_self!
|
||||
FeedManager.instance.push_to_home(@account, @status, update: update?) if @account.local?
|
||||
end
|
||||
|
@ -242,6 +248,10 @@ class FanOutOnWriteService < BaseService
|
|||
@status.public_unlisted_visibility? && !@status.reblog? && !@account.silenced?
|
||||
end
|
||||
|
||||
def broadcastable_unlisted2?
|
||||
@status.unlisted_visibility? && @status.public_searchability? && !@status.reblog? && !@account.silenced?
|
||||
end
|
||||
|
||||
class AntennaCollection
|
||||
def initialize(status, update, stl_home = false) # rubocop:disable Style/OptionalBooleanParameter
|
||||
@status = status
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue