5
0
Fork 0
mirror of https://0xacab.org/sutty/sutty synced 2024-11-30 10:26:22 +00:00

Merge branch 'issue-15109-1' of https://0xacab.org/sutty/sutty into production.panel.sutty.nl

This commit is contained in:
Sutty 2024-03-06 17:31:59 +00:00
commit de9777e251
4 changed files with 10 additions and 12 deletions

View file

@ -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

View file

@ -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?

View file

@ -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

View file

@ -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