0
0
Fork 0

Adding unified streamable notifications

This commit is contained in:
Eugen Rochko 2016-11-20 00:33:02 +01:00
parent 3838e6836d
commit da2ef4d676
20 changed files with 205 additions and 44 deletions

View file

@ -65,8 +65,8 @@ class ProcessInteractionService < BaseService
end
def follow!(account, target_account)
account.follow!(target_account)
NotificationMailer.follow(target_account, account).deliver_later unless target_account.blocking?(account)
follow = account.follow!(target_account)
NotifyService.new.call(target_account, follow)
end
def unfollow!(account, target_account)
@ -83,8 +83,8 @@ class ProcessInteractionService < BaseService
def favourite!(xml, from_account)
current_status = status(xml)
current_status.favourites.where(account: from_account).first_or_create!(account: from_account)
NotificationMailer.favourite(current_status, from_account).deliver_later unless current_status.account.blocking?(from_account)
favourite = current_status.favourites.where(account: from_account).first_or_create!(account: from_account)
NotifyService.new.call(current_status.account, favourite)
end
def add_post!(body, account)