Fix issue with actors without followers/following collection
parent
5eba16751a
commit
9012356a19
|
@ -209,7 +209,7 @@ def object_visibility(ap_activity: RawObject, actor: "Actor") -> VisibilityEnum:
|
||||||
return VisibilityEnum.PUBLIC
|
return VisibilityEnum.PUBLIC
|
||||||
elif AS_PUBLIC in cc:
|
elif AS_PUBLIC in cc:
|
||||||
return VisibilityEnum.UNLISTED
|
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
|
return VisibilityEnum.FOLLOWERS_ONLY
|
||||||
else:
|
else:
|
||||||
return VisibilityEnum.DIRECT
|
return VisibilityEnum.DIRECT
|
||||||
|
|
|
@ -103,8 +103,8 @@ class Actor:
|
||||||
return self.ap_actor.get("tag", [])
|
return self.ap_actor.get("tag", [])
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def followers_collection_id(self) -> str:
|
def followers_collection_id(self) -> str | None:
|
||||||
return self.ap_actor["followers"]
|
return self.ap_actor.get("followers")
|
||||||
|
|
||||||
|
|
||||||
class RemoteActor(Actor):
|
class RemoteActor(Actor):
|
||||||
|
|
Loading…
Reference in New Issue