=> 4c6157d0573e37643a466d63f7f43530c2f81a0e
[1mdiff --git a/feeds.py b/feeds.py[m [1mindex 7db831c..6950efe 100644[m [1m--- a/feeds.py[m [1m+++ b/feeds.py[m [36m@@ -329,10 +329,10 @@[m [mdef make_post_page(session, post):[m if session.is_likes_enabled():[m liked = [][m if post.num_likes:[m [31m- liked = db.get_likes(post)[m [32m+[m[32m liked = db.get_likes(post, session.user_mutes)[m page += ' ยท ๐ ' + ', '.join(liked)[m if session.is_reactions_enabled():[m [31m- reactions = db.get_reactions(post)[m [32m+[m[32m reactions = db.get_reactions(post, session.user_mutes)[m listed = [][m for r in reactions:[m listed.append(f'{reactions[r]} {r}')[m [1mdiff --git a/model.py b/model.py[m [1mindex e4aeada..09e9816 100644[m [1m--- a/model.py[m [1m+++ b/model.py[m [36m@@ -1912,13 +1912,15 @@[m [mclass Database:[m (Notification.REACTION, user.id, post.user, post.id))[m self.commit()[m [m [31m- def get_reactions(self, post) -> dict:[m [32m+[m[32m def get_reactions(self, post, user_mutes=set()) -> dict:[m """Returns a dictionary of {reactions: count}."""[m [m cur = self.conn.cursor()[m [31m- cur.execute("SELECT reaction FROM reactions WHERE post=?", (post.id,))[m [32m+[m[32m cur.execute("SELECT reaction, user FROM reactions WHERE post=?", (post.id,))[m counts = {}[m [31m- for (r,) in cur:[m [32m+[m[32m for (r, user_id) in cur:[m [32m+[m[32m if (MUTE_USER, user_id) in user_mutes:[m [32m+[m[32m continue[m if r not in counts:[m counts[r] = 1[m else:[m [36m@@ -1931,17 +1933,18 @@[m [mclass Database:[m for (r,) in cur: return r[m return None[m [m [31m- def get_likes(self, post):[m [32m+[m[32m def get_likes(self, post, user_mutes=set()):[m cur = self.conn.cursor()[m cur.execute("""[m [31m- SELECT u.name[m [32m+[m[32m SELECT u.name, u.id[m FROM likes[m JOIN users u ON likes.user=u.id[m WHERE likes.post=?[m """, (post.id,))[m users = [][m [31m- for (name,) in cur:[m [31m- users.append(name)[m [32m+[m[32m for (name, liker_id) in cur:[m [32m+[m[32m if not (MUTE_USER, liker_id) in user_mutes:[m [32m+[m[32m users.append(name)[m return users[m [m def get_tags(self, post):[m
text/gemini; charset=utf-8
This content has been proxied by September (ba2dc).