diff options
author | Andrew Godwin | 2022-12-16 20:04:28 -0700 |
---|---|---|
committer | Andrew Godwin | 2022-12-16 20:04:28 -0700 |
commit | e5b76c120e27bad7c6e4ec323ffc2e65d7dfb654 (patch) | |
tree | afe144887bb1a0613c463fe3024f5cd9665028c1 | |
parent | 4a28e1708e1cd6d9cbbfe41d94ff9d7f646f6c94 (diff) | |
download | takahe-e5b76c120e27bad7c6e4ec323ffc2e65d7dfb654.tar.gz takahe-e5b76c120e27bad7c6e4ec323ffc2e65d7dfb654.tar.bz2 takahe-e5b76c120e27bad7c6e4ec323ffc2e65d7dfb654.zip |
Fetch emoji for user profiles
-rw-r--r-- | core/models/config.py | 2 | ||||
-rw-r--r-- | static/css/style.css | 6 | ||||
-rw-r--r-- | users/models/identity.py | 7 |
3 files changed, 13 insertions, 2 deletions
diff --git a/core/models/config.py b/core/models/config.py index 48da7de..a651396 100644 --- a/core/models/config.py +++ b/core/models/config.py @@ -225,7 +225,7 @@ class Config(models.Model): hashtag_unreviewed_are_public: bool = True hashtag_stats_max_age: int = 60 * 60 - emoji_unreviewed_are_public: bool = False + emoji_unreviewed_are_public: bool = True cache_timeout_page_default: int = 60 cache_timeout_page_timeline: int = 60 * 3 diff --git a/static/css/style.css b/static/css/style.css index 200a74b..aa68280 100644 --- a/static/css/style.css +++ b/static/css/style.css @@ -341,6 +341,10 @@ body.no-sidebar .right-column { text-transform: uppercase; } +img.emoji { + height: 0.8em; +} + /* Icon menus */ .icon-menu .option { @@ -377,7 +381,7 @@ body.no-sidebar .right-column { } .icon-menu .option img.emoji { - height: 22px; + height: 20px; } .icon-menu .option i { 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)() |