Handle language'd public keys

This commit is contained in:
Andrew Godwin 2022-12-22 05:59:07 +00:00
parent 8729baaea4
commit ff38948b2f
1 changed files with 3 additions and 0 deletions

View File

@ -644,6 +644,9 @@ class Identity(StatorModel):
self.manually_approves_followers = document.get("manuallyApprovesFollowers") self.manually_approves_followers = document.get("manuallyApprovesFollowers")
self.public_key = document.get("publicKey", {}).get("publicKeyPem") self.public_key = document.get("publicKey", {}).get("publicKeyPem")
self.public_key_id = document.get("publicKey", {}).get("id") self.public_key_id = document.get("publicKey", {}).get("id")
# Sometimes the public key PEM is in a language construct?
if isinstance(self.public_key, dict):
self.public_key = self.public_key["@value"]
self.icon_uri = get_first_image_url(document.get("icon", None)) self.icon_uri = get_first_image_url(document.get("icon", None))
self.image_uri = get_first_image_url(document.get("image", None)) self.image_uri = get_first_image_url(document.get("image", None))
self.discoverable = document.get("toot:discoverable", True) self.discoverable = document.get("toot:discoverable", True)