Follow requests send e-mail notifications, but are excluded from notifications API
Better initial state for unlisted/nsfw toggles
This commit is contained in:
@ -20,7 +20,12 @@ class FollowService < BaseService
|
||||
private
|
||||
|
||||
def request_follow(source_account, target_account)
|
||||
FollowRequest.create!(account: source_account, target_account: target_account)
|
||||
return unless target_account.local?
|
||||
|
||||
follow_request = FollowRequest.create!(account: source_account, target_account: target_account)
|
||||
NotifyService.new.call(target_account, follow_request)
|
||||
|
||||
follow_request
|
||||
end
|
||||
|
||||
def direct_follow(source_account, target_account)
|
||||
|
@ -32,6 +32,10 @@ class NotifyService < BaseService
|
||||
false
|
||||
end
|
||||
|
||||
def blocked_follow_request?
|
||||
false
|
||||
end
|
||||
|
||||
def blocked?
|
||||
blocked = @recipient.suspended? # Skip if the recipient account is suspended anyway
|
||||
blocked ||= @recipient.id == @notification.from_account.id # Skip for interactions with self
|
||||
@ -45,6 +49,7 @@ class NotifyService < BaseService
|
||||
|
||||
def create_notification
|
||||
@notification.save!
|
||||
return unless @notification.browserable?
|
||||
FeedManager.instance.broadcast(@recipient.id, type: 'notification', message: FeedManager.instance.inline_render(@recipient, 'api/v1/notifications/show', @notification))
|
||||
end
|
||||
|
||||
|
Reference in New Issue
Block a user