Merge pull request #3370 from Tak/add-hashtag-to-context

Add `as:Hashtag` to activitypub context
This commit is contained in:
Mouse Reeve 2024-06-01 18:48:38 -07:00 committed by GitHub
commit 4d3d5d15d0
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 6 additions and 1 deletions

View file

@ -250,7 +250,10 @@ class ActivityObject:
pass pass
data = {k: v for (k, v) in data.items() if v is not None and k not in omit} data = {k: v for (k, v) in data.items() if v is not None and k not in omit}
if "@context" not in omit: if "@context" not in omit:
data["@context"] = "https://www.w3.org/ns/activitystreams" data["@context"] = [
"https://www.w3.org/ns/activitystreams",
{"Hashtag": "as:Hashtag"},
]
return data return data

View file

@ -331,6 +331,7 @@ class User(OrderedCollectionPageMixin, AbstractUser):
"https://w3id.org/security/v1", "https://w3id.org/security/v1",
{ {
"manuallyApprovesFollowers": "as:manuallyApprovesFollowers", "manuallyApprovesFollowers": "as:manuallyApprovesFollowers",
"Hashtag": "as:Hashtag",
"schema": "http://schema.org#", "schema": "http://schema.org#",
"PropertyValue": "schema:PropertyValue", "PropertyValue": "schema:PropertyValue",
"value": "schema:value", "value": "schema:value",

View file

@ -95,6 +95,7 @@ class User(TestCase):
"PropertyValue": "schema:PropertyValue", "PropertyValue": "schema:PropertyValue",
"alsoKnownAs": {"@id": "as:alsoKnownAs", "@type": "@id"}, "alsoKnownAs": {"@id": "as:alsoKnownAs", "@type": "@id"},
"manuallyApprovesFollowers": "as:manuallyApprovesFollowers", "manuallyApprovesFollowers": "as:manuallyApprovesFollowers",
"Hashtag": "as:Hashtag",
"movedTo": {"@id": "as:movedTo", "@type": "@id"}, "movedTo": {"@id": "as:movedTo", "@type": "@id"},
"schema": "http://schema.org#", "schema": "http://schema.org#",
"value": "schema:value", "value": "schema:value",