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/services/unfavourite_service.rb

17 lines
395 B
Ruby
Raw Normal View History

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