mirror of
https://github.com/glitch-soc/mastodon.git
synced 2025-12-13 15:58:50 +00:00
Compare commits
2 Commits
v4.3.10
...
feature-pr
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
20fe22a4a9 | ||
|
|
bd110a3d7d |
@@ -135,6 +135,10 @@ class Account < ApplicationRecord
|
|||||||
!subscription_expires_at.blank?
|
!subscription_expires_at.blank?
|
||||||
end
|
end
|
||||||
|
|
||||||
|
def followers_domains
|
||||||
|
followers.reorder(nil).pluck('distinct accounts.domain')
|
||||||
|
end
|
||||||
|
|
||||||
def favourited?(status)
|
def favourited?(status)
|
||||||
status.proper.favourites.where(account: self).count.positive?
|
status.proper.favourites.where(account: self).count.positive?
|
||||||
end
|
end
|
||||||
|
|||||||
@@ -8,12 +8,14 @@ class Pubsubhubbub::DistributionWorker
|
|||||||
def perform(stream_entry_id)
|
def perform(stream_entry_id)
|
||||||
stream_entry = StreamEntry.find(stream_entry_id)
|
stream_entry = StreamEntry.find(stream_entry_id)
|
||||||
|
|
||||||
return if stream_entry.hidden?
|
return if stream_entry.status.direct_visibility?
|
||||||
|
|
||||||
account = stream_entry.account
|
account = stream_entry.account
|
||||||
payload = AtomSerializer.render(AtomSerializer.new.feed(account, [stream_entry]))
|
payload = AtomSerializer.render(AtomSerializer.new.feed(account, [stream_entry]))
|
||||||
|
domains = account.followers_domains
|
||||||
|
|
||||||
Subscription.where(account: account).active.select('id, callback_url').find_each do |subscription|
|
Subscription.where(account: account).active.select('id, callback_url').find_each do |subscription|
|
||||||
|
next unless domains.include?(Addressable::URI.parse(subscription.callback_url).host)
|
||||||
Pubsubhubbub::DeliveryWorker.perform_async(subscription.id, payload)
|
Pubsubhubbub::DeliveryWorker.perform_async(subscription.id, payload)
|
||||||
end
|
end
|
||||||
rescue ActiveRecord::RecordNotFound
|
rescue ActiveRecord::RecordNotFound
|
||||||
|
|||||||
Reference in New Issue
Block a user