Fixes error adding unlisted statuses

This commit is contained in:
Mouse Reeve 2021-03-26 12:09:37 -07:00
parent abc732cdfe
commit ee067b7d65

View file

@ -88,7 +88,7 @@ class ActivityStream(ABC):
""" given a status, what users should see it """ """ given a status, what users should see it """
# direct messages don't appeard in feeds, direct comments/reviews/etc do # direct messages don't appeard in feeds, direct comments/reviews/etc do
if status.privacy == "direct" and status.status_type == "Note": if status.privacy == "direct" and status.status_type == "Note":
return None return []
# everybody who could plausibly see this status # everybody who could plausibly see this status
audience = models.User.objects.filter( audience = models.User.objects.filter(
@ -150,7 +150,7 @@ class LocalStream(ActivityStream):
def stream_users(self, status): def stream_users(self, status):
# this stream wants no part in non-public statuses # this stream wants no part in non-public statuses
if status.privacy != "public" or not status.user.local: if status.privacy != "public" or not status.user.local:
return None return []
return super().stream_users(status) return super().stream_users(status)
def stream_statuses(self, user): def stream_statuses(self, user):
@ -170,7 +170,7 @@ class FederatedStream(ActivityStream):
def stream_users(self, status): def stream_users(self, status):
# this stream wants no part in non-public statuses # this stream wants no part in non-public statuses
if status.privacy != "public": if status.privacy != "public":
return None return []
return super().stream_users(status) return super().stream_users(status)
def stream_statuses(self, user): def stream_statuses(self, user):