logo

mastofe

My custom branche(s) on git.pleroma.social/pleroma/mastofe git clone https://hacktivis.me/git/mastofe.git

streamable.rb (522B)


  1. # frozen_string_literal: true
  2. module Streamable
  3. extend ActiveSupport::Concern
  4. included do
  5. has_one :stream_entry, as: :activity
  6. after_create do
  7. account.stream_entries.create!(activity: self, hidden: hidden?) if needs_stream_entry?
  8. end
  9. end
  10. def title
  11. super
  12. end
  13. def content
  14. title
  15. end
  16. def target
  17. super
  18. end
  19. def object_type
  20. :activity
  21. end
  22. def thread
  23. super
  24. end
  25. def hidden?
  26. false
  27. end
  28. private
  29. def needs_stream_entry?
  30. account.local?
  31. end
  32. end