Merge branch 'master' into glitch-soc/merge-upstream
Conflicts: - app/controllers/accounts_controller.rb - app/controllers/follower_accounts_controller.rb - app/controllers/statuses_controller.rb All conflicts caused by the additional `use_pack` used for glitch-soc's theming system.
This commit is contained in:
@@ -13,6 +13,7 @@
|
||||
# action_taken_by_account_id :bigint(8)
|
||||
# target_account_id :bigint(8) not null
|
||||
# assigned_account_id :bigint(8)
|
||||
# uri :string
|
||||
#
|
||||
|
||||
class Report < ApplicationRecord
|
||||
@@ -28,6 +29,12 @@ class Report < ApplicationRecord
|
||||
|
||||
validates :comment, length: { maximum: 1000 }
|
||||
|
||||
def local?
|
||||
false # Force uri_for to use uri attribute
|
||||
end
|
||||
|
||||
before_validation :set_uri, only: :create
|
||||
|
||||
def object_type
|
||||
:flag
|
||||
end
|
||||
@@ -89,4 +96,8 @@ class Report < ApplicationRecord
|
||||
|
||||
Admin::ActionLog.from("(#{sql}) AS admin_action_logs")
|
||||
end
|
||||
|
||||
def set_uri
|
||||
self.uri = ActivityPub::TagManager.instance.generate_uri_for(self) if uri.nil? && account.local?
|
||||
end
|
||||
end
|
||||
|
||||
@@ -473,8 +473,8 @@ class Status < ApplicationRecord
|
||||
end
|
||||
|
||||
def set_visibility
|
||||
self.visibility = reblog.visibility if reblog? && visibility.nil?
|
||||
self.visibility = (account.locked? ? :private : :public) if visibility.nil?
|
||||
self.visibility = reblog.visibility if reblog?
|
||||
self.sensitive = false if sensitive.nil?
|
||||
end
|
||||
|
||||
|
||||
Reference in New Issue
Block a user