Limit broadcast with viewer-aware users

Removes inactive or blocked users
This commit is contained in:
Mouse Reeve 2021-04-11 09:09:13 -07:00
parent 89d3c3e82b
commit 26f16cf5a4
1 changed files with 2 additions and 1 deletions

View File

@ -64,6 +64,7 @@ class ActivitypubMixin:
) )
if hasattr(self, "property_fields"): if hasattr(self, "property_fields"):
self.activity_fields += [ self.activity_fields += [
# pylint: disable=cell-var-from-loop
PropertyField(lambda a, o: set_activity_from_property_field(a, o, f)) PropertyField(lambda a, o: set_activity_from_property_field(a, o, f))
for f in self.property_fields for f in self.property_fields
] ]
@ -152,7 +153,7 @@ class ActivitypubMixin:
# unless it's a dm, all the followers should receive the activity # unless it's a dm, all the followers should receive the activity
if privacy != "direct": if privacy != "direct":
# we will send this out to a subset of all remote users # we will send this out to a subset of all remote users
queryset = user_model.objects.filter( queryset = user_model.viewer_aware_objects(user).filter(
local=False, local=False,
) )
# filter users first by whether they're using the desired software # filter users first by whether they're using the desired software