0
0
Fork 0

Add follow request banner on account header (#20785)

* Add requested_by to relationship maps

* Display whether an account has requested to follow you on their profile
This commit is contained in:
Claire 2022-12-15 18:50:11 +01:00 committed by GitHub
parent 7a3c6bb888
commit 70415714f1
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
10 changed files with 127 additions and 4 deletions

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