0
0
Fork 0

Add support for fediverse:creator OpenGraph tag (#30398)

This commit is contained in:
Eugen Rochko 2024-05-29 01:34:33 +02:00 committed by GitHub
parent 4a77e477ee
commit 128987eded
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
11 changed files with 105 additions and 15 deletions

View file

@ -32,6 +32,7 @@
# link_type :integer
# published_at :datetime
# image_description :string default(""), not null
# author_account_id :bigint(8)
#
class PreviewCard < ApplicationRecord
@ -54,6 +55,7 @@ class PreviewCard < ApplicationRecord
has_many :statuses, through: :preview_cards_statuses
has_one :trend, class_name: 'PreviewCardTrend', inverse_of: :preview_card, dependent: :destroy
belongs_to :author_account, class_name: 'Account', optional: true
has_attached_file :image, processors: [:thumbnail, :blurhash_transcoder], styles: ->(f) { image_styles(f) }, convert_options: { all: '-quality 90 +profile "!icc,*" +set date:modify +set date:create +set date:timestamp' }, validate_media_type: false

View file

@ -157,9 +157,9 @@ class Status < ApplicationRecord
:status_stat,
:tags,
:preloadable_poll,
preview_cards_status: [:preview_card],
preview_cards_status: { preview_card: { author_account: [:account_stat, user: :role] } },
account: [:account_stat, user: :role],
active_mentions: { account: :account_stat },
active_mentions: :account,
reblog: [
:application,
:tags,
@ -167,11 +167,11 @@ class Status < ApplicationRecord
:conversation,
:status_stat,
:preloadable_poll,
preview_cards_status: [:preview_card],
preview_cards_status: { preview_card: { author_account: [:account_stat, user: :role] } },
account: [:account_stat, user: :role],
active_mentions: { account: :account_stat },
active_mentions: :account,
],
thread: { account: :account_stat }
thread: :account
delegate :domain, to: :account, prefix: true