1
0
Fork 0
mirror of https://github.com/mastodon/mastodon.git synced 2024-08-20 21:08:15 -07:00
mastodon/app/serializers/rest/muted_account_serializer.rb
OSAMU SATO 96761752ec
Add duration parameter to muting. (#13831)
* Adding duration to muting.

* Remove useless checks
2020-10-13 01:01:14 +02:00

10 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