0
0
Fork 0

Add ability to filter followed accounts' posts by language (#19095)

This commit is contained in:
Eugen Rochko 2022-09-20 23:51:21 +02:00 committed by GitHub
parent 882e54c786
commit 50948b46aa
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
30 changed files with 298 additions and 39 deletions

View file

@ -1,7 +1,7 @@
# frozen_string_literal: true
class REST::RelationshipSerializer < ActiveModel::Serializer
attributes :id, :following, :showing_reblogs, :notifying, :followed_by,
attributes :id, :following, :showing_reblogs, :notifying, :languages, :followed_by,
:blocking, :blocked_by, :muting, :muting_notifications, :requested,
:domain_blocking, :endorsed, :note
@ -25,6 +25,11 @@ class REST::RelationshipSerializer < ActiveModel::Serializer
false
end
def languages
(instance_options[:relationships].following[object.id] || {})[:languages] ||
(instance_options[:relationships].requested[object.id] || {})[:languages]
end
def followed_by
instance_options[:relationships].followed_by[object.id] || false
end