Merge branch 'master' into glitch-soc/merge-upstream

Conflicts:
- `app/javascript/packs/public.js`:
  Upstream modified code that we split between multiple files due
  to glitch-soc's theming system.
  Ported those changes.
This commit is contained in:
Thibaut Girka
2020-04-05 18:32:06 +02:00
70 changed files with 1316 additions and 226 deletions

View File

@@ -14,6 +14,7 @@
# created_at :datetime not null
# updated_at :datetime not null
# published_at :datetime
# status_ids :bigint is an Array
#
class Announcement < ApplicationRecord
@@ -49,7 +50,13 @@ class Announcement < ApplicationRecord
end
def statuses
@statuses ||= Status.from_text(text)
@statuses ||= begin
if status_ids.nil?
[]
else
Status.where(id: status_ids, visibility: [:public, :unlisted])
end
end
end
def tags

View File

@@ -18,6 +18,9 @@
class Report < ApplicationRecord
include Paginable
include RateLimitable
rate_limit by: :account, family: :reports
belongs_to :account
belongs_to :target_account, class_name: 'Account'

View File

@@ -429,7 +429,7 @@ class Status < ApplicationRecord
if TagManager.instance.local_url?(url)
ActivityPub::TagManager.instance.uri_to_resource(url, Status)
else
Status.find_by(uri: url) || Status.find_by(url: url)
EntityCache.instance.status(url)
end
end
status&.distributable? ? status : nil