about summary refs log tree commit diff
path: root/app/serializers/rest/muted_account_serializer.rb
blob: 3ddd706dcd327b0f28c81f878e052745c442ecb8 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
# frozen_string_literal: true

class REST::MutedAccountSerializer < REST::AccountSerializer
  attribute :mute_expires_at

  def mute_expires_at
    mute = current_user.account.mute_relationships.find_by(target_account_id: object.id)
    mute && !mute.expired? ? mute.expires_at : nil
  end
end