5
0
Fork 0
mirror of https://0xacab.org/sutty/sutty synced 2024-11-26 15:56:21 +00:00

feat: al moderar una cuenta, también moderar sus comentarios

This commit is contained in:
f 2024-03-08 15:31:41 -03:00
parent 6b74bc454d
commit 071102fa3b
No known key found for this signature in database
3 changed files with 20 additions and 4 deletions

View file

@ -42,19 +42,35 @@ class ActorModeration < ApplicationRecord
end
end
# Al permitir una cuenta se permiten todos los comentarios
# pendientes de moderación que ya hizo.
event :allow do
transitions from: %i[paused blocked reported], to: :allowed
before do
allow_remotely!
site.activity_pubs.paused.where(actor_id: self.actor_id).find_each do |activity_pub|
activity_pub.allow! if activity_pub.may_allow?
rescue Exception => e
ExceptionNotifier.notify_exception(e, data: { site: site.name, activity_pub: activity_pub_id })
end
end
end
# Al bloquear una cuenta se bloquean todos los comentarios
# pendientes de moderación que hizo.
event :block do
transitions from: %i[paused allowed], to: :blocked
before do
block_remotely!
site.activity_pubs.paused.where(actor_id: self.actor_id).find_each do |activity_pub|
activity_pub.reject! if activity_pub.may_reject?
rescue Exception => e
ExceptionNotifier.notify_exception(e, data: { site: site.name, activity_pub: activity_pub_id })
end
end
end

View file

@ -138,10 +138,10 @@ en:
success: "Account paused. All of their comments will need to be moderated individually on the Comments section."
error: "There was an error while pausing the account. We received a report and will be acting on it soon."
allow:
success: "Account allowed. All of their comments will be approved automatically."
success: "Account allowed. All of their comments will be approved automatically. Any pending comments have been approved."
error: "There was an error while allowing the account. We received a report and will be acting on it soon."
block:
success: "Account blocked. All of their comments will be rejected automatically. If you want to report it to their instance, please use the Report button."
success: "Account blocked. All of their comments will be rejected automatically. Any pending comments have been rejected. If you want to report it to their instance, please use the Report button."
error: "There was an error while blocking the account. We received a report and will be acting on it soon."
report:
success: "Account reported."

View file

@ -137,10 +137,10 @@ es:
success: "Cuenta pausada. Todos los comentarios que haga necesitan ser aprobados manualmente en la sección Comentarios."
error: "No se pudo pausar la cuenta. Hemos recibido el reporte y lo estaremos verificando."
allow:
success: "Cuenta permitida. Todos los comentarios que haga serán aprobados inmediatamente."
success: "Cuenta permitida. Todos los comentarios que haga serán aprobados inmediatamente. Todos los comentarios pendientes de moderación fueron aprobados."
error: "No se pudo permitir la cuenta. Hemos recibido el reporte y lo estaremos verificando."
block:
success: "Cuenta bloqueada. Todos los comentarios que haga serán rechazados inmediatamente. Si querés reportarla a su instancia, podés usar el botón Reportar."
success: "Cuenta bloqueada. Todos los comentarios que haga serán rechazados inmediatamente. Todos los comentarios pendientes de moderación fueron rechazados. Si querés reportarla a su instancia, podés usar el botón Reportar."
error: "No se pudo bloquear la cuenta. Hemos recibido el reporte y lo estaremos verificando."
report:
success: "Cuenta reportada a su instancia."