mirror of
https://code.eliotberriot.com/funkwhale/funkwhale.git
synced 2025-10-04 04:39:16 +02:00
Fix #737: delivering of local activities causing unintended side effects, such as rollbacking changes
This commit is contained in:
parent
ff03909ca3
commit
0afa4f2e27
5 changed files with 79 additions and 58 deletions
|
@ -73,7 +73,7 @@ def get_files(storage, *parts):
|
|||
|
||||
@celery.app.task(name="federation.dispatch_inbox")
|
||||
@celery.require_instance(models.Activity.objects.select_related(), "activity")
|
||||
def dispatch_inbox(activity):
|
||||
def dispatch_inbox(activity, call_handlers=True):
|
||||
"""
|
||||
Given an activity instance, triggers our internal delivery logic (follow
|
||||
creation, etc.)
|
||||
|
@ -86,6 +86,7 @@ def dispatch_inbox(activity):
|
|||
"actor": activity.actor,
|
||||
"inbox_items": activity.inbox_items.filter(is_read=False),
|
||||
},
|
||||
call_handlers=call_handlers,
|
||||
)
|
||||
|
||||
|
||||
|
@ -98,7 +99,7 @@ def dispatch_outbox(activity):
|
|||
inbox_items = activity.inbox_items.filter(is_read=False).select_related()
|
||||
|
||||
if inbox_items.exists():
|
||||
dispatch_inbox.delay(activity_id=activity.pk)
|
||||
dispatch_inbox.delay(activity_id=activity.pk, call_handlers=False)
|
||||
|
||||
if not preferences.get("federation__enabled"):
|
||||
# federation is disabled, we only deliver to local recipients
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue