他サーバーからカスタム絵文字によるスタンプを受け取った時に、ライセンス情報を保存する+ついでにテスト (#65)

* Wip: スタンプを他サーバーから受信するテスト作成、カスタム絵文字にdomainプロパティを追加

* Wip: ドメインに関するイレギュラーな状況に対応

* Wip: 他のサーバーのカスタム絵文字を送信するときのID変更処理を追加

* Wip: カスタム絵文字のIDを判定する場所を変更

* Wip: カスタム絵文字のURIを返す処理を削除(不要)

* Wip: 絵文字リアクション受け入れ処理リファクタリング

* Wip: 外部へ送信するカスタム絵文字データにライセンス情報を追加、ライセンス情報の受信をテストに追加

* Wip: ドメインブロックのテストを追加

* Wip: ついでに通常のドメインブロックを追加
This commit is contained in:
KMY(雪あすか) 2023-10-07 11:57:38 +09:00 committed by KMY
parent 3ccf0d02c6
commit f0fac9be8f
4 changed files with 273 additions and 16 deletions

View file

@ -5,7 +5,9 @@ class ActivityPub::EmojiSerializer < ActivityPub::Serializer
context_extensions :emoji
attributes :id, :type, :name, :updated
attributes :id, :type, :domain, :name, :is_sensitive, :updated
attribute :license, if: -> { object.license.present? }
has_one :icon, serializer: ActivityPub::ImageSerializer
@ -17,6 +19,10 @@ class ActivityPub::EmojiSerializer < ActivityPub::Serializer
'Emoji'
end
def domain
object.domain.presence || Rails.configuration.x.local_domain
end
def icon
object.image
end