5
0
Fork 0
mirror of https://0xacab.org/sutty/sutty synced 2024-11-22 22:46:22 +00:00
panel/app/processors/activity_pub_processor.rb

23 lines
678 B
Ruby
Raw Normal View History

2024-03-04 14:59:29 +00:00
# frozen_string_literal: true
# Gestiona los filtros de ActivityPub
class ActivityPubProcessor < Rubanok::Processor
# En orden descendiente para encontrar la última actividad
#
# Por ahora solo queremos moderar comentarios.
prepare do
2024-03-15 21:05:05 +00:00
raw
.joins(:activities)
.where(
activity_pub_activities: {
type: %w[ActivityPub::Activity::Create ActivityPub::Activity::Update]
},
object_type: %w[ActivityPub::Object::Note ActivityPub::Object::Article]
).order(updated_at: :desc)
2024-03-04 14:59:29 +00:00
end
map :activity_pub_state, activate_always: true do |activity_pub_state: 'paused'|
raw.where(aasm_state: activity_pub_state)
end
end