mirror of
https://git.sr.ht/~tsileo/microblog.pub
synced 2024-12-22 05:04:27 +00:00
Add support for profile metadata
This commit is contained in:
parent
119bbdcede
commit
606a2dfa68
1 changed files with 9 additions and 1 deletions
10
config.py
10
config.py
|
@ -10,6 +10,7 @@ from itsdangerous import JSONWebSignatureSerializer
|
|||
from little_boxes import strtobool
|
||||
from little_boxes.activitypub import CTX_AS as AP_DEFAULT_CTX
|
||||
from pymongo import MongoClient
|
||||
from bleach import linkify
|
||||
|
||||
import sass
|
||||
from utils.emojis import _load_emojis
|
||||
|
@ -128,6 +129,13 @@ def _admin_jwt_token() -> str:
|
|||
|
||||
ADMIN_API_KEY = get_secret_key("admin_api_key", _admin_jwt_token)
|
||||
|
||||
attachments = []
|
||||
if conf.get("profile_metadata"):
|
||||
for key, value in conf["profile_metadata"].items():
|
||||
attachments.append(
|
||||
{"type": "PropertyValue", "name": key, "value": linkify(value)}
|
||||
)
|
||||
|
||||
ME = {
|
||||
"@context": DEFAULT_CTX,
|
||||
"type": "Person",
|
||||
|
@ -143,7 +151,7 @@ ME = {
|
|||
"endpoints": {},
|
||||
"url": ID,
|
||||
"manuallyApprovesFollowers": False,
|
||||
"attachment": [],
|
||||
"attachment": attachments,
|
||||
"icon": {
|
||||
"mediaType": mimetypes.guess_type(ICON_URL)[0],
|
||||
"type": "Image",
|
||||
|
|
Loading…
Reference in a new issue