summaryrefslogtreecommitdiffstats
path: root/activities/views
diff options
context:
space:
mode:
authorMichael Manfre2022-12-15 02:50:54 -0500
committerGitHub2022-12-15 00:50:54 -0700
commitaf3142ac3adb0d1f31d160edcb6d076b293020b1 (patch)
tree73cfd5d447f6444602c2ff401399d567c673949b /activities/views
parent69f1b3168ac3f29fc4bafba0418769248b10062a (diff)
downloadtakahe-af3142ac3adb0d1f31d160edcb6d076b293020b1.tar.gz
takahe-af3142ac3adb0d1f31d160edcb6d076b293020b1.tar.bz2
takahe-af3142ac3adb0d1f31d160edcb6d076b293020b1.zip
Basic Emoji suppport (#157)
Diffstat (limited to 'activities/views')
-rw-r--r--activities/views/posts.py2
-rw-r--r--activities/views/timelines.py16
2 files changed, 13 insertions, 5 deletions
diff --git a/activities/views/posts.py b/activities/views/posts.py
index e285c7e..1b8676d 100644
--- a/activities/views/posts.py
+++ b/activities/views/posts.py
@@ -67,6 +67,8 @@ class Individual(TemplateView):
in_reply_to=self.post_obj.object_uri,
)
.distinct()
+ .select_related("author__domain")
+ .prefetch_related("emojis")
.order_by("published", "created"),
}
diff --git a/activities/views/timelines.py b/activities/views/timelines.py
index 0c1b693..f55e331 100644
--- a/activities/views/timelines.py
+++ b/activities/views/timelines.py
@@ -98,8 +98,8 @@ class Local(ListView):
def get_queryset(self):
return (
Post.objects.local_public()
- .select_related("author")
- .prefetch_related("attachments", "mentions")
+ .select_related("author", "author__domain")
+ .prefetch_related("attachments", "mentions", "emojis")
.order_by("-created")[:50]
)
@@ -126,8 +126,8 @@ class Federated(ListView):
Post.objects.filter(
visibility=Post.Visibilities.public, in_reply_to__isnull=True
)
- .select_related("author")
- .prefetch_related("attachments", "mentions")
+ .select_related("author", "author__domain")
+ .prefetch_related("attachments", "mentions", "emojis")
.order_by("-created")[:50]
)
@@ -173,7 +173,13 @@ class Notifications(ListView):
return (
TimelineEvent.objects.filter(identity=self.request.identity, type__in=types)
.order_by("-created")[:50]
- .select_related("subject_post", "subject_post__author", "subject_identity")
+ .select_related(
+ "subject_post",
+ "subject_post__author",
+ "subject_post__author__domain",
+ "subject_identity",
+ )
+ .prefetch_related("subject_post__emojis")
)
def get_context_data(self, **kwargs):