Add group account support
This commit is contained in:
parent
b08cc0eaea
commit
05211ac206
11 changed files with 64 additions and 4 deletions
18
app/services/group_reblog_service.rb
Normal file
18
app/services/group_reblog_service.rb
Normal file
|
@ -0,0 +1,18 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
class GroupReblogService < BaseService
|
||||
|
||||
def call(status)
|
||||
visibility = status.visibility.to_sym
|
||||
return nil if visibility != :public && visibility != :public_unlisted && visibility != :unlisted
|
||||
|
||||
accounts = status.mentions.map(&:account) | status.active_mentions.map(&:account)
|
||||
|
||||
accounts.each do |account|
|
||||
next unless account.local?
|
||||
next if account.group_message_following_only && !account.following?(status.account)
|
||||
|
||||
ReblogService.new.call(account, status, { visibility: status.visibility }) if account.group?
|
||||
end
|
||||
end
|
||||
end
|
Loading…
Add table
Add a link
Reference in a new issue