mirror of
https://git.sr.ht/~tsileo/microblog.pub
synced 2024-12-22 13:14:28 +00:00
Fix issue with actors without followers/following collection
This commit is contained in:
parent
5eba16751a
commit
9012356a19
2 changed files with 3 additions and 3 deletions
|
@ -209,7 +209,7 @@ def object_visibility(ap_activity: RawObject, actor: "Actor") -> VisibilityEnum:
|
|||
return VisibilityEnum.PUBLIC
|
||||
elif AS_PUBLIC in cc:
|
||||
return VisibilityEnum.UNLISTED
|
||||
elif actor.followers_collection_id in to + cc:
|
||||
elif actor.followers_collection_id and actor.followers_collection_id in to + cc:
|
||||
return VisibilityEnum.FOLLOWERS_ONLY
|
||||
else:
|
||||
return VisibilityEnum.DIRECT
|
||||
|
|
|
@ -103,8 +103,8 @@ class Actor:
|
|||
return self.ap_actor.get("tag", [])
|
||||
|
||||
@property
|
||||
def followers_collection_id(self) -> str:
|
||||
return self.ap_actor["followers"]
|
||||
def followers_collection_id(self) -> str | None:
|
||||
return self.ap_actor.get("followers")
|
||||
|
||||
|
||||
class RemoteActor(Actor):
|
||||
|
|
Loading…
Reference in a new issue