Make emoji better on the wire

pull/184/head
Andrew Godwin 2022-12-16 22:20:58 -07:00
rodzic 606c628343
commit d7ffb47fb2
2 zmienionych plików z 2 dodań i 2 usunięć

Wyświetl plik

@ -214,7 +214,7 @@ class Emoji(StatorModel):
""" """
return { return {
"id": self.object_uri or f"https://{settings.MAIN_DOMAIN}/emoji/{self.pk}/", "id": self.object_uri or f"https://{settings.MAIN_DOMAIN}/emoji/{self.pk}/",
"type": "Emoji", "type": "toot:Emoji",
"name": self.shortcode, "name": self.shortcode,
"icon": { "icon": {
"type": "Image", "type": "Image",

Wyświetl plik

@ -679,7 +679,7 @@ class Post(StatorModel):
post.mentions.add(mention_identity) post.mentions.add(mention_identity)
elif tag["type"].lower() == "hashtag": elif tag["type"].lower() == "hashtag":
post.hashtags.append(tag["name"].lower().lstrip("#")) post.hashtags.append(tag["name"].lower().lstrip("#"))
elif tag["type"].lower() == "toot:emoji": elif tag["type"].lower() in ["toot:emoji", "emoji"]:
emoji = Emoji.by_ap_tag(post.author.domain, tag, create=True) emoji = Emoji.by_ap_tag(post.author.domain, tag, create=True)
post.emojis.add(emoji) post.emojis.add(emoji)
else: else: