gearheads
/
mastodon
Archived
2
0
Fork 0
This repository has been archived on 2024-06-09. You can view files and clone it, but cannot push or open issues/pull-requests.
mastodon/app/serializers/rest/muted_account_serializer.rb

11 lines
294 B
Ruby

# 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