summaryrefslogtreecommitdiffstats
path: root/users/models
diff options
context:
space:
mode:
Diffstat (limited to 'users/models')
-rw-r--r--users/models/identity.py7
1 files changed, 7 insertions, 0 deletions
diff --git a/users/models/identity.py b/users/models/identity.py
index 9462fee..a1167e5 100644
--- a/users/models/identity.py
+++ b/users/models/identity.py
@@ -429,6 +429,8 @@ class Identity(StatorModel):
Fetches the user's actor information, as well as their domain from
webfinger if it's available.
"""
+ from activities.models import Emoji
+
if self.local:
raise ValueError("Cannot fetch local identities")
try:
@@ -501,6 +503,11 @@ class Identity(StatorModel):
self.domain = await get_domain(actor_url_parts.hostname)
else:
self.domain = await get_domain(actor_url_parts.hostname)
+ # Emojis (we need the domain so we do them here)
+ for tag in get_list(document, "tag"):
+ if tag["type"].lower() == "toot:emoji":
+ await sync_to_async(Emoji.by_ap_tag)(self.domain, tag, create=True)
+ # Mark as fetched
self.fetched = timezone.now()
try:
await sync_to_async(self.save)()