diff options
author | Andrew Godwin | 2022-12-15 18:58:11 -0700 |
---|---|---|
committer | Andrew Godwin | 2022-12-15 18:58:11 -0700 |
commit | c0cd5a55530079a6ba11f65065658b4fd1236a86 (patch) | |
tree | 694c534fea54aa24fa3fe99a648706b60ae8f57e /core | |
parent | 31dc08ad0dfe7c0b5e8491b30b9dab415d44210d (diff) | |
download | takahe-c0cd5a55530079a6ba11f65065658b4fd1236a86.tar.gz takahe-c0cd5a55530079a6ba11f65065658b4fd1236a86.tar.bz2 takahe-c0cd5a55530079a6ba11f65065658b4fd1236a86.zip |
Some hashtag json-ld fiddling
Diffstat (limited to 'core')
-rw-r--r-- | core/ld.py | 18 |
1 files changed, 11 insertions, 7 deletions
@@ -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 |