From c0cd5a55530079a6ba11f65065658b4fd1236a86 Mon Sep 17 00:00:00 2001 From: Andrew Godwin Date: Thu, 15 Dec 2022 18:58:11 -0700 Subject: Some hashtag json-ld fiddling --- core/ld.py | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) (limited to 'core') diff --git a/core/ld.py b/core/ld.py index 4b01e71..950bf06 100644 --- a/core/ld.py +++ b/core/ld.py @@ -407,14 +407,18 @@ def canonicalise(json_data: dict, include_security: bool = False) -> dict: """ if not isinstance(json_data, dict): raise ValueError("Pass decoded JSON data into LDDocument") - context: str | list[str] + context = [ + "https://www.w3.org/ns/activitystreams", + { + "sensitive": "as:sensitive", + "toot": "http://joinmastodon.org/ns#", + "votersCount": "toot:votersCount", + "Hashtag": "as:Hashtag", + "Public": "as:Public", + }, + ] if include_security: - context = [ - "https://www.w3.org/ns/activitystreams", - "https://w3id.org/security/v1", - ] - else: - context = "https://www.w3.org/ns/activitystreams" + context.append("https://w3id.org/security/v1") if "@context" not in json_data: json_data["@context"] = context -- cgit v1.2.3