Make follow requests federate

This commit is contained in:
Eugen Rochko
2017-02-11 02:12:05 +01:00
parent d551e43a9b
commit 149887a0ff
25 changed files with 148 additions and 61 deletions

View File

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