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:
parent
7a3c6bb888
commit
70415714f1
10 changed files with 127 additions and 4 deletions
|
@ -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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue