mirror of https://gitlab.com/bashrc2/epicyon
Set context for outgoing actor updates
parent
84535174e7
commit
ab3e3eb772
|
@ -55,6 +55,7 @@ from donate import getWebsite
|
||||||
from donate import setWebsite
|
from donate import setWebsite
|
||||||
from person import setPersonNotes
|
from person import setPersonNotes
|
||||||
from person import getDefaultPersonContext
|
from person import getDefaultPersonContext
|
||||||
|
from person import getUpdateActorContext
|
||||||
from person import savePersonQrcode
|
from person import savePersonQrcode
|
||||||
from person import randomizeActorImages
|
from person import randomizeActorImages
|
||||||
from person import personUpgradeActor
|
from person import personUpgradeActor
|
||||||
|
@ -5819,12 +5820,12 @@ class PubServer(BaseHTTPRequestHandler):
|
||||||
pubStr = 'https://www.w3.org/ns/' + \
|
pubStr = 'https://www.w3.org/ns/' + \
|
||||||
'activitystreams#Public'
|
'activitystreams#Public'
|
||||||
pubNumber, pubDate = getStatusNumber()
|
pubNumber, pubDate = getStatusNumber()
|
||||||
pubContext = actorJson['@context'].copy()
|
|
||||||
# remove the context from the actor json and put it
|
# remove the context from the actor json and put it
|
||||||
# at the start of the Upgrade activity
|
# at the start of the Upgrade activity
|
||||||
del actorJson['@context']
|
del actorJson['@context']
|
||||||
|
updateActorContext = getUpdateActorContext()
|
||||||
updateActorJson = {
|
updateActorJson = {
|
||||||
'@context': pubContext,
|
'@context': updateActorContext,
|
||||||
'id': actorJson['id'] + '#updates/' + pubNumber,
|
'id': actorJson['id'] + '#updates/' + pubNumber,
|
||||||
'type': 'Update',
|
'type': 'Update',
|
||||||
'actor': actorJson['id'],
|
'actor': actorJson['id'],
|
||||||
|
|
74
person.py
74
person.py
|
@ -187,6 +187,80 @@ def randomizeActorImages(personJson: {}) -> None:
|
||||||
'/image' + randStr + '.' + existingExtension
|
'/image' + randStr + '.' + existingExtension
|
||||||
|
|
||||||
|
|
||||||
|
def getUpdateActorContext() -> []:
|
||||||
|
"""Returns the context used on actor updates
|
||||||
|
"""
|
||||||
|
return [
|
||||||
|
"https://www.w3.org/ns/activitystreams",
|
||||||
|
"https://w3id.org/security/v1",
|
||||||
|
{
|
||||||
|
"manuallyApprovesFollowers": "as:manuallyApprovesFollowers",
|
||||||
|
"toot": "http://joinmastodon.org/ns#",
|
||||||
|
"featured":
|
||||||
|
{
|
||||||
|
"@id": "toot:featured",
|
||||||
|
"@type": "@id"
|
||||||
|
},
|
||||||
|
"featuredTags":
|
||||||
|
{
|
||||||
|
"@id": "toot:featuredTags",
|
||||||
|
"@type": "@id"
|
||||||
|
},
|
||||||
|
"alsoKnownAs":
|
||||||
|
{
|
||||||
|
"@id": "as:alsoKnownAs",
|
||||||
|
"@type": "@id"
|
||||||
|
},
|
||||||
|
"movedTo":
|
||||||
|
{
|
||||||
|
"@id": "as:movedTo",
|
||||||
|
"@type": "@id"
|
||||||
|
},
|
||||||
|
"schema": "http://schema.org#",
|
||||||
|
"PropertyValue": "schema:PropertyValue",
|
||||||
|
"value": "schema:value",
|
||||||
|
"IdentityProof": "toot:IdentityProof",
|
||||||
|
"discoverable": "toot:discoverable",
|
||||||
|
"Device": "toot:Device",
|
||||||
|
"Ed25519Signature": "toot:Ed25519Signature",
|
||||||
|
"Ed25519Key": "toot:Ed25519Key",
|
||||||
|
"Curve25519Key": "toot:Curve25519Key",
|
||||||
|
"EncryptedMessage": "toot:EncryptedMessage",
|
||||||
|
"publicKeyBase64": "toot:publicKeyBase64",
|
||||||
|
"deviceId": "toot:deviceId",
|
||||||
|
"claim":
|
||||||
|
{
|
||||||
|
"@type": "@id",
|
||||||
|
"@id": "toot:claim"
|
||||||
|
},
|
||||||
|
"fingerprintKey":
|
||||||
|
{
|
||||||
|
"@type": "@id",
|
||||||
|
"@id": "toot:fingerprintKey"
|
||||||
|
},
|
||||||
|
"identityKey":
|
||||||
|
{
|
||||||
|
"@type": "@id",
|
||||||
|
"@id": "toot:identityKey"
|
||||||
|
},
|
||||||
|
"devices":
|
||||||
|
{
|
||||||
|
"@type": "@id",
|
||||||
|
"@id": "toot:devices"
|
||||||
|
},
|
||||||
|
"messageFranking": "toot:messageFranking",
|
||||||
|
"messageType": "toot:messageType",
|
||||||
|
"cipherText": "toot:cipherText",
|
||||||
|
"suspended": "toot:suspended",
|
||||||
|
"focalPoint":
|
||||||
|
{
|
||||||
|
"@container": "@list",
|
||||||
|
"@id": "toot:focalPoint"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
]
|
||||||
|
|
||||||
|
|
||||||
def getDefaultPersonContext() -> str:
|
def getDefaultPersonContext() -> str:
|
||||||
"""Gets the default actor context
|
"""Gets the default actor context
|
||||||
"""
|
"""
|
||||||
|
|
Loading…
Reference in New Issue