and atom feed generation to some extent, as well as the way mentions are storedmain
parent
9594f0e858
commit
a08e724476
@ -0,0 +1,11 @@
|
||||
class FeedManager
|
||||
MAX_ITEMS = 800
|
||||
|
||||
def self.key(type, id)
|
||||
"feed:#{type}:#{id}"
|
||||
end
|
||||
|
||||
def self.filter_status?(status, follower)
|
||||
(status.reply? && !(follower.id = replied_to_user.id || follower.following?(replied_to_user)))
|
||||
end
|
||||
end
|
@ -0,0 +1,31 @@
|
||||
module Streamable
|
||||
extend ActiveSupport::Concern
|
||||
|
||||
included do
|
||||
has_one :stream_entry, as: :activity
|
||||
|
||||
def title
|
||||
super
|
||||
end
|
||||
|
||||
def content
|
||||
title
|
||||
end
|
||||
|
||||
def target
|
||||
super
|
||||
end
|
||||
|
||||
def object_type
|
||||
:activity
|
||||
end
|
||||
|
||||
def thread
|
||||
super
|
||||
end
|
||||
|
||||
after_create do
|
||||
self.account.stream_entries.create!(activity: self)
|
||||
end
|
||||
end
|
||||
end
|
@ -0,0 +1,9 @@
|
||||
module Targetable
|
||||
extend ActiveSupport::Concern
|
||||
|
||||
included do
|
||||
def object_type
|
||||
:object
|
||||
end
|
||||
end
|
||||
end
|
Loading…
Reference in new issue