diff options
author | Andrew Godwin | 2022-12-15 17:00:00 -0700 |
---|---|---|
committer | Andrew Godwin | 2022-12-15 17:00:00 -0700 |
commit | 31dc08ad0dfe7c0b5e8491b30b9dab415d44210d (patch) | |
tree | e05213f1354c676eacca1749f7499238a8ab26bd /activities/models | |
parent | 3907a10d2e279d1974a829598067aea3797883dc (diff) | |
download | takahe-31dc08ad0dfe7c0b5e8491b30b9dab415d44210d.tar.gz takahe-31dc08ad0dfe7c0b5e8491b30b9dab415d44210d.tar.bz2 takahe-31dc08ad0dfe7c0b5e8491b30b9dab415d44210d.zip |
Add hashtags to post objects
Diffstat (limited to 'activities/models')
-rw-r--r-- | activities/models/post.py | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/activities/models/post.py b/activities/models/post.py index 599a1ea..d31b52c 100644 --- a/activities/models/post.py +++ b/activities/models/post.py @@ -537,6 +537,15 @@ class Post(StatorModel): for mention in self.mentions.all(): value["tag"].append(mention.to_ap_tag()) value["cc"].append(mention.actor_uri) + # Hashtags + for hashtag in self.hashtags or []: + value["tag"].append( + { + "href": f"https://{self.author.domain.uri_domain}/tags/{hashtag}/", + "name": f"#{hashtag}", + "type": "as:Hashtag", + } + ) # Emoji for emoji in self.emojis.all(): value["tag"].append(emoji.to_ap_tag()) |