Separate PuSH subscriptions from following, add mastodon:push:refresh task,

respect hub.lease_seconds (fix #46)
This commit is contained in:
Eugen Rochko
2016-09-20 00:39:03 +02:00
parent 1245ee42fb
commit 059ebbf48d
10 changed files with 77 additions and 43 deletions

View File

@ -12,6 +12,7 @@ class FollowService < BaseService
if target_account.local?
NotificationMailer.follow(target_account, source_account).deliver_later
else
subscribe_service.(target_account)
NotificationWorker.perform_async(follow.stream_entry.id, target_account.id)
end
@ -40,4 +41,8 @@ class FollowService < BaseService
def follow_remote_account_service
@follow_remote_account_service ||= FollowRemoteAccountService.new
end
def subscribe_service
@subscribe_service ||= SubscribeService.new
end
end