1
0
mirror of https://github.com/mastodon/mastodon synced 2024-11-28 23:08:25 +09:00
mastodon/app/serializers/rest/muted_account_serializer.rb

11 lines
294 B
Ruby
Raw Normal View History

# 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