Improve admin actor profile
This commit is contained in:
parent
4cbfb396c6
commit
7782a39638
4 changed files with 33 additions and 15 deletions
|
@ -1,6 +1,7 @@
|
|||
import hashlib
|
||||
import typing
|
||||
from dataclasses import dataclass
|
||||
from functools import cached_property
|
||||
from typing import Union
|
||||
from urllib.parse import urlparse
|
||||
|
||||
|
@ -66,8 +67,8 @@ class Actor:
|
|||
return self.ap_actor["inbox"]
|
||||
|
||||
@property
|
||||
def shared_inbox_url(self) -> str | None:
|
||||
return self.ap_actor.get("endpoints", {}).get("sharedInbox")
|
||||
def shared_inbox_url(self) -> str:
|
||||
return self.ap_actor.get("endpoints", {}).get("sharedInbox") or self.inbox_url
|
||||
|
||||
@property
|
||||
def icon_url(self) -> str | None:
|
||||
|
@ -107,6 +108,10 @@ class Actor:
|
|||
def followers_collection_id(self) -> str | None:
|
||||
return self.ap_actor.get("followers")
|
||||
|
||||
@cached_property
|
||||
def attachments(self) -> list[ap.RawObject]:
|
||||
return ap.as_list(self.ap_actor.get("attachment", []))
|
||||
|
||||
|
||||
class RemoteActor(Actor):
|
||||
def __init__(self, ap_actor: ap.RawObject) -> None:
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue