Merge branch 'master' into glitch-soc/merge-upstream
Conflicts: - Gemfile.lock - app/controllers/accounts_controller.rb - app/controllers/admin/dashboard_controller.rb - app/controllers/follower_accounts_controller.rb - app/controllers/following_accounts_controller.rb - app/controllers/remote_follow_controller.rb - app/controllers/stream_entries_controller.rb - app/controllers/tags_controller.rb - app/javascript/packs/public.js - app/lib/sanitize_config.rb - app/models/account.rb - app/models/form/admin_settings.rb - app/models/media_attachment.rb - app/models/stream_entry.rb - app/models/user.rb - app/serializers/initial_state_serializer.rb - app/services/batched_remove_status_service.rb - app/services/post_status_service.rb - app/services/process_mentions_service.rb - app/services/reblog_service.rb - app/services/remove_status_service.rb - app/views/admin/settings/edit.html.haml - config/locales/simple_form.pl.yml - config/settings.yml - docker-compose.yml
This commit is contained in:
@ -31,7 +31,6 @@ class Status < ApplicationRecord
|
||||
before_destroy :unlink_from_conversations
|
||||
|
||||
include Paginable
|
||||
include Streamable
|
||||
include Cacheable
|
||||
include StatusThreadingConcern
|
||||
|
||||
@ -65,7 +64,6 @@ class Status < ApplicationRecord
|
||||
has_and_belongs_to_many :preview_cards
|
||||
|
||||
has_one :notification, as: :activity, dependent: :destroy
|
||||
has_one :stream_entry, as: :activity, inverse_of: :status
|
||||
has_one :status_stat, inverse_of: :status
|
||||
has_one :poll, inverse_of: :status, dependent: :destroy
|
||||
|
||||
@ -113,13 +111,11 @@ class Status < ApplicationRecord
|
||||
:status_stat,
|
||||
:tags,
|
||||
:preview_cards,
|
||||
:stream_entry,
|
||||
:preloadable_poll,
|
||||
account: :account_stat,
|
||||
active_mentions: { account: :account_stat },
|
||||
reblog: [
|
||||
:application,
|
||||
:stream_entry,
|
||||
:tags,
|
||||
:preview_cards,
|
||||
:media_attachments,
|
||||
@ -204,7 +200,7 @@ class Status < ApplicationRecord
|
||||
end
|
||||
|
||||
def hidden?
|
||||
private_visibility? || direct_visibility? || limited_visibility?
|
||||
!distributable?
|
||||
end
|
||||
|
||||
def distributable?
|
||||
@ -523,7 +519,8 @@ class Status < ApplicationRecord
|
||||
end
|
||||
|
||||
def update_statistics
|
||||
return unless public_visibility? || unlisted_visibility?
|
||||
return unless distributable?
|
||||
|
||||
ActivityTracker.increment('activity:statuses:local')
|
||||
end
|
||||
|
||||
@ -532,7 +529,7 @@ class Status < ApplicationRecord
|
||||
|
||||
account&.increment_count!(:statuses_count)
|
||||
reblog&.increment_count!(:reblogs_count) if reblog?
|
||||
thread&.increment_count!(:replies_count) if in_reply_to_id.present? && (public_visibility? || unlisted_visibility?)
|
||||
thread&.increment_count!(:replies_count) if in_reply_to_id.present? && distributable?
|
||||
end
|
||||
|
||||
def decrement_counter_caches
|
||||
@ -540,7 +537,7 @@ class Status < ApplicationRecord
|
||||
|
||||
account&.decrement_count!(:statuses_count)
|
||||
reblog&.decrement_count!(:reblogs_count) if reblog?
|
||||
thread&.decrement_count!(:replies_count) if in_reply_to_id.present? && (public_visibility? || unlisted_visibility?)
|
||||
thread&.decrement_count!(:replies_count) if in_reply_to_id.present? && distributable?
|
||||
end
|
||||
|
||||
def unlink_from_conversations
|
||||
|
Reference in New Issue
Block a user