From 1670c922693dee6e64a3d076c5f09be11191a20e Mon Sep 17 00:00:00 2001 From: Andrew Godwin Date: Sat, 28 Jan 2023 11:00:48 -0700 Subject: [PATCH] Send out emoji tags for identities --- users/models/identity.py | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/users/models/identity.py b/users/models/identity.py index 6863dd0..754fe77 100644 --- a/users/models/identity.py +++ b/users/models/identity.py @@ -489,6 +489,8 @@ class Identity(StatorModel): } def to_ap(self): + from activities.models import Emoji + response = { "id": self.actor_uri, "type": self.actor_type.title(), @@ -533,6 +535,14 @@ class Identity(StatorModel): } for item in self.metadata ] + # Emoji + emojis = Emoji.emojis_from_content( + (self.name or "") + " " + (self.summary or ""), None + ) + if emojis: + response["tag"] = [] + for emoji in emojis: + response["tag"].append(emoji.to_ap_tag()) return response def to_ap_tag(self):