Skip to content

Commit

Permalink
Merge pull request #3370 from Tak/add-hashtag-to-context
Browse files Browse the repository at this point in the history
Add `as:Hashtag` to activitypub context
  • Loading branch information
mouse-reeve committed Jun 2, 2024
2 parents d90e8e5 + 4654445 commit 4d3d5d1
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 1 deletion.
5 changes: 4 additions & 1 deletion bookwyrm/activitypub/base_activity.py
Original file line number Diff line number Diff line change
Expand Up @@ -250,7 +250,10 @@ def serialize(self, **kwargs):
pass
data = {k: v for (k, v) in data.items() if v is not None and k 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


Expand Down
1 change: 1 addition & 0 deletions bookwyrm/models/user.py
Original file line number Diff line number Diff line change
Expand Up @@ -331,6 +331,7 @@ def to_activity(self, **kwargs):
"https://w3id.org/security/v1",
{
"manuallyApprovesFollowers": "as:manuallyApprovesFollowers",
"Hashtag": "as:Hashtag",
"schema": "http://schema.org#",
"PropertyValue": "schema:PropertyValue",
"value": "schema:value",
Expand Down
1 change: 1 addition & 0 deletions bookwyrm/tests/models/test_user_model.py
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,7 @@ def test_activitypub_serialize(self):
"PropertyValue": "schema:PropertyValue",
"alsoKnownAs": {"@id": "as:alsoKnownAs", "@type": "@id"},
"manuallyApprovesFollowers": "as:manuallyApprovesFollowers",
"Hashtag": "as:Hashtag",
"movedTo": {"@id": "as:movedTo", "@type": "@id"},
"schema": "http://schema.org#",
"value": "schema:value",
Expand Down

0 comments on commit 4d3d5d1

Please sign in to comment.