add `skip_notify` option to service objects we might use for post imports
parent
811137ef69
commit
55e0484121
|
@ -7,7 +7,7 @@ class FavouriteService < BaseService
|
|||
# @param [Account] account
|
||||
# @param [Status] status
|
||||
# @return [Favourite]
|
||||
def call(account, status)
|
||||
def call(account, status, skip_notify = false)
|
||||
authorize_with account, status, :favourite?
|
||||
|
||||
favourite = Favourite.find_by(account: account, status: status)
|
||||
|
@ -17,7 +17,7 @@ class FavouriteService < BaseService
|
|||
favourite = Favourite.create!(account: account, status: status)
|
||||
|
||||
curate_status(status)
|
||||
create_notification(favourite)
|
||||
create_notification(favourite) unless skip_notify
|
||||
bump_potential_friendship(account, status)
|
||||
|
||||
favourite
|
||||
|
|
|
@ -4,7 +4,7 @@ class ProcessMentionsService < BaseService
|
|||
# Scan status for mentions and fetch remote mentioned users, create
|
||||
# local mention pointers
|
||||
# @param [Status] status
|
||||
def call(status)
|
||||
def call(status, skip_notify = false)
|
||||
return unless status.local? && !status.draft?
|
||||
|
||||
@status = status
|
||||
|
@ -31,6 +31,7 @@ class ProcessMentionsService < BaseService
|
|||
|
||||
status.save!
|
||||
|
||||
return if skip_notify
|
||||
mentions.each { |mention| create_notification(mention) }
|
||||
end
|
||||
|
||||
|
|
|
@ -28,7 +28,7 @@ class ReblogService < BaseService
|
|||
end
|
||||
|
||||
curate_status(reblogged_status)
|
||||
create_notification(reblog)
|
||||
create_notification(reblog) unless options[:skip_notify]
|
||||
bump_potential_friendship(account, reblog)
|
||||
|
||||
reblog
|
||||
|
|
Loading…
Reference in New Issue