mirror of
https://0xacab.org/sutty/sutty
synced 2024-11-22 09:06:22 +00:00
fix: no mostrar likes #15596
This commit is contained in:
parent
364b63a075
commit
00270b7829
2 changed files with 22 additions and 3 deletions
|
@ -6,6 +6,12 @@
|
|||
# una actividad, puede estar destinada a varies actores dentro de Sutty,
|
||||
# con lo que generamos una cola para cada une.
|
||||
#
|
||||
#
|
||||
# @todo Ya que une actore puede hacer varias actividades sobre el mismo
|
||||
# objeto, lo correcto sería que la actividad a moderar sea una sola en
|
||||
# lugar de una lista acumulativa. Es decir cada ActivityPub representa
|
||||
# el estado del conjunto (Actor, Object, Activity)
|
||||
#
|
||||
# @see {https://www.w3.org/TR/activitypub/#client-to-server-interactions}
|
||||
class ActivityPub < ApplicationRecord
|
||||
IGNORED_EVENTS = %i[pause remove].freeze
|
||||
|
@ -105,10 +111,16 @@ class ActivityPub < ApplicationRecord
|
|||
# disponible, que según el scope por defecto, va a ser la primera de
|
||||
# la lista.
|
||||
def reject_remotely!
|
||||
raise unless site.social_inbox.inbox.reject(id: activities.first.uri).ok?
|
||||
fail! unless site.social_inbox.inbox.reject(id: activities.first.uri).ok?
|
||||
end
|
||||
|
||||
def allow_remotely!
|
||||
raise unless site.social_inbox.inbox.accept(id: activities.first.uri).ok?
|
||||
with_failure_handling(activity: activities.first.uri) do
|
||||
fail! unless site.social_inbox.inbox.accept(id: activities.first.uri).ok?
|
||||
end
|
||||
end
|
||||
|
||||
def fail_message
|
||||
activities.first&.uri || 'Activity missing'
|
||||
end
|
||||
end
|
||||
|
|
|
@ -6,7 +6,14 @@ class ActivityPubProcessor < Rubanok::Processor
|
|||
#
|
||||
# Por ahora solo queremos moderar comentarios.
|
||||
prepare do
|
||||
raw.where(object_type: %w[ActivityPub::Object::Note ActivityPub::Object::Article]).order(updated_at: :desc)
|
||||
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)
|
||||
end
|
||||
|
||||
map :activity_pub_state, activate_always: true do |activity_pub_state: 'paused'|
|
||||
|
|
Loading…
Reference in a new issue