mirror of
https://0xacab.org/sutty/sutty
synced 2024-11-16 07:31:41 +00:00
feat: al activar el fediverso, activar las listas de bloqueo
This commit is contained in:
parent
342521c897
commit
aae04f3739
1 changed files with 13 additions and 0 deletions
|
@ -8,6 +8,7 @@ class DeploySocialDistributedPress < Deploy
|
||||||
DEPENDENCIES = %i[deploy_distributed_press deploy_rsync deploy_full_rsync].freeze
|
DEPENDENCIES = %i[deploy_distributed_press deploy_rsync deploy_full_rsync].freeze
|
||||||
|
|
||||||
after_save :create_hooks!
|
after_save :create_hooks!
|
||||||
|
after_create :enable_fediblocks!
|
||||||
|
|
||||||
# Envía las notificaciones
|
# Envía las notificaciones
|
||||||
def deploy(output: false)
|
def deploy(output: false)
|
||||||
|
@ -95,4 +96,16 @@ class DeploySocialDistributedPress < Deploy
|
||||||
ExceptionNotifier.notify_exception(e, data: { site_id: site.name, usuarie_id: rol.usuarie_id })
|
ExceptionNotifier.notify_exception(e, data: { site_id: site.name, usuarie_id: rol.usuarie_id })
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
# Habilita todos los fediblocks disponibles.
|
||||||
|
#
|
||||||
|
# @todo Hacer que algunos sean opcionales
|
||||||
|
# @todo Mover a un Job
|
||||||
|
def enable_fediblocks!
|
||||||
|
ActivityPub::Fediblock.find_each do |fediblock|
|
||||||
|
site.fediblock_states.find_or_create_by(fediblock: fediblock).tap do |state|
|
||||||
|
state.enable! if state.may_enable?
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
Loading…
Reference in a new issue