mirror of
https://git.sr.ht/~tsileo/microblog.pub
synced 2025-06-05 21:59:23 +02:00
Improve admin actor profile
This commit is contained in:
@ -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:
|
||||
|
Reference in New Issue
Block a user