1
0
mirror of https://github.com/funamitech/mastodon synced 2024-11-28 06:48:45 +09:00
YuruToot/app/services/unfavourite_service.rb

17 lines
395 B
Ruby
Raw Normal View History

# frozen_string_literal: true
class UnfavouriteService < BaseService
2017-02-11 10:12:05 +09:00
include StreamEntryRenderer
def call(account, status)
favourite = Favourite.find_by!(account: account, status: status)
favourite.destroy!
unless status.local?
2017-02-11 10:12:05 +09:00
NotificationWorker.perform_async(stream_entry_to_xml(favourite.stream_entry), account.id, status.account_id)
end
favourite
end
end