Add option to set image_url ("background image") for user
While this option is not used anywhere in microblog.pub itself, some other servers do occasionally use it when showing remote profiles. Also, this image _can_ be used in microblog.pub - just add this: <img src="{{ local_actor.image_url }}"> in the appropriate place of your template!
This commit is contained in:
parent
4c995957a6
commit
4613997fe3
3 changed files with 14 additions and 0 deletions
|
@ -88,6 +88,10 @@ class Actor:
|
|||
def icon_media_type(self) -> str | None:
|
||||
return self.ap_actor.get("icon", {}).get("mediaType")
|
||||
|
||||
@property
|
||||
def image_url(self) -> str | None:
|
||||
return self.ap_actor.get("image", {}).get("url")
|
||||
|
||||
@property
|
||||
def public_key_as_pem(self) -> str:
|
||||
return self.ap_actor["publicKey"]["publicKeyPem"]
|
||||
|
@ -381,6 +385,9 @@ def _actor_hash(actor: Actor) -> bytes:
|
|||
if actor.icon_url:
|
||||
h.update(actor.icon_url.encode())
|
||||
|
||||
if actor.image_url:
|
||||
h.update(actor.image_url.encode())
|
||||
|
||||
if actor.attachments:
|
||||
for a in actor.attachments:
|
||||
if a.get("type") != "PropertyValue":
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue