Fix detection of unlisted posts (#3258)

Merged from dato/fix_unlisted_set_from_activity.
This commit is contained in:
Adeodato Simó 2024-03-27 16:29:09 -03:00 committed by GitHub
commit 699d637bae
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -260,12 +260,12 @@ class PrivacyField(ActivitypubFieldMixin, models.CharField):
if to == [self.public]: if to == [self.public]:
setattr(instance, self.name, "public") setattr(instance, self.name, "public")
elif self.public in cc:
setattr(instance, self.name, "unlisted")
elif to == [user.followers_url]: elif to == [user.followers_url]:
setattr(instance, self.name, "followers") setattr(instance, self.name, "followers")
elif cc == []: elif cc == []:
setattr(instance, self.name, "direct") setattr(instance, self.name, "direct")
elif self.public in cc:
setattr(instance, self.name, "unlisted")
else: else:
setattr(instance, self.name, "followers") setattr(instance, self.name, "followers")
return original == getattr(instance, self.name) return original == getattr(instance, self.name)