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

View File

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