Update actor context when saved

main
Bob Mottram 2020-08-05 11:33:47 +01:00
parent ed24c2140a
commit c682c759ba
2 changed files with 9 additions and 0 deletions

View File

@ -43,6 +43,7 @@ from matrix import getMatrixAddress
from matrix import setMatrixAddress
from donate import getDonationUrl
from donate import setDonationUrl
from person import getDefaultPersonContext
from person import savePersonQrcode
from person import randomizeActorImages
from person import personUpgradeActor
@ -6616,6 +6617,12 @@ class PubServer(BaseHTTPRequestHandler):
os.remove(gitProjectsFilename)
# save actor json file within accounts
if actorChanged:
# update the context for the actor
actorJson['@context'] = [
'https://www.w3.org/ns/activitystreams',
'https://w3id.org/security/v1',
getDefaultPersonContext()
]
randomizeActorImages(actorJson)
saveJson(actorJson, actorFilename)
webfingerUpdate(self.server.baseDir,

View File

@ -164,6 +164,8 @@ def randomizeActorImages(personJson: {}) -> None:
def getDefaultPersonContext() -> str:
"""Gets the default actor context
"""
return {
'Emoji': 'toot:Emoji',
'Hashtag': 'as:Hashtag',