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

Conflicts:
- `README.md`:
  Discarded upstream changes: we have our own README
- `app/controllers/follower_accounts_controller.rb`:
  Port upstream's minor refactoring
This commit is contained in:
Claire
2022-12-15 20:25:25 +01:00
103 changed files with 1228 additions and 274 deletions

View File

@ -30,7 +30,7 @@ class InitialStateSerializer < ActiveModel::Serializer
streaming_api_base_url: Rails.configuration.x.streaming_api_base_url,
access_token: object.token,
locale: I18n.locale,
domain: instance_presenter.domain,
domain: Addressable::IDNA.to_unicode(instance_presenter.domain),
title: instance_presenter.title,
admin: object.admin&.id&.to_s,
search_enabled: Chewy.enabled?,

View File

@ -2,8 +2,8 @@
class REST::RelationshipSerializer < ActiveModel::Serializer
attributes :id, :following, :showing_reblogs, :notifying, :languages, :followed_by,
:blocking, :blocked_by, :muting, :muting_notifications, :requested,
:domain_blocking, :endorsed, :note
:blocking, :blocked_by, :muting, :muting_notifications,
:requested, :requested_by, :domain_blocking, :endorsed, :note
def id
object.id.to_s
@ -54,6 +54,10 @@ class REST::RelationshipSerializer < ActiveModel::Serializer
instance_options[:relationships].requested[object.id] ? true : false
end
def requested_by
instance_options[:relationships].requested_by[object.id] ? true : false
end
def domain_blocking
instance_options[:relationships].domain_blocking[object.id] || false
end