diff --git a/app/models/activity_pub.rb b/app/models/activity_pub.rb index b07fe790..3887d512 100644 --- a/app/models/activity_pub.rb +++ b/app/models/activity_pub.rb @@ -68,8 +68,7 @@ class ActivityPub < ApplicationRecord transitions from: %i[paused], to: :approved before do - raise AASM::InvalidTransition unless - site.social_inbox.inbox.accept(id: object.uri).ok? + raise unless site.social_inbox.inbox.accept(id: object.uri).ok? end end @@ -78,8 +77,7 @@ class ActivityPub < ApplicationRecord transitions from: %i[paused approved], to: :rejected before do - raise AASM::InvalidTransition unless - site.social_inbox.inbox.reject(id: object.uri).ok? + raise unless site.social_inbox.inbox.reject(id: object.uri).ok? end end diff --git a/app/models/actor_moderation.rb b/app/models/actor_moderation.rb index d7eea709..5d44a021 100644 --- a/app/models/actor_moderation.rb +++ b/app/models/actor_moderation.rb @@ -65,21 +65,21 @@ class ActorModeration < ApplicationRecord end def pause_remotely! - raise AASM::InvalidTransition unless + raise unless actor.mention && site.social_inbox.allowlist.delete(list: [actor.mention]).ok? && site.social_inbox.blocklist.delete(list: [actor.mention]).ok? end def allow_remotely! - raise AASM::InvalidTransition unless + raise unless actor.mention && site.social_inbox.allowlist.post(list: [actor.mention]).ok? && site.social_inbox.blocklist.delete(list: [actor.mention]).ok? end def block_remotely! - raise AASM::InvalidTransition unless + raise unless actor.mention && site.social_inbox.allowlist.delete(list: [actor.mention]).ok? && site.social_inbox.blocklist.post(list: [actor.mention]).ok? diff --git a/app/models/fediblock_state.rb b/app/models/fediblock_state.rb index 180a45b5..214e2f5e 100644 --- a/app/models/fediblock_state.rb +++ b/app/models/fediblock_state.rb @@ -89,14 +89,14 @@ class FediblockState < ApplicationRecord # Al deshabilitar, las instancias pasan a ser analizadas caso por caso def disable_remotely! - raise AASM::InvalidTransition unless + raise unless site.social_inbox.blocklist.delete(list: list_names).ok? && site.social_inbox.allowlist.delete(list: list_names).ok? end # Al habilitar, se bloquean todas las instancias de la lista def enable_remotely! - raise AASM::InvalidTransition unless + raise unless site.social_inbox.blocklist.post(list: list_names).ok? && site.social_inbox.allowlist.delete(list: list_names).ok? end diff --git a/app/models/instance_moderation.rb b/app/models/instance_moderation.rb index 7447cc89..ef04b7ff 100644 --- a/app/models/instance_moderation.rb +++ b/app/models/instance_moderation.rb @@ -60,7 +60,7 @@ class InstanceModeration < ApplicationRecord # # @return [Boolean] def pause_remotely! - raise AASM::InvalidTransition unless + raise unless site.social_inbox.blocklist.delete(list: [instance.list_name]).ok? && site.social_inbox.allowlist.delete(list: [instance.list_name]).ok? end @@ -69,7 +69,7 @@ class InstanceModeration < ApplicationRecord # # @return [Boolean] def block_remotely! - raise AASM::InvalidTransition unless + raise unless site.social_inbox.allowlist.delete(list: [instance.list_name]).ok? && site.social_inbox.blocklist.post(list: [instance.list_name]).ok? end @@ -78,7 +78,7 @@ class InstanceModeration < ApplicationRecord # # @return [Boolean] def allow_remotely! - raise AASM::InvalidTransition unless + raise unless site.social_inbox.blocklist.delete(list: [instance.list_name]).ok? && site.social_inbox.allowlist.post(list: [instance.list_name]).ok? end