From 707a4a11cb3695c8ef55b797fbcade84b13764d7 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Jaakko=20Kera=CC=88nen?= jaakko.keranen@iki.fi
Date: Tue, 6 Jun 2023 00:12:24 +0300
Subject: [PATCH 1/1] Adjusting mutes
Muting a post only affects notifications. Muting a subspace still
allows viewing the subspace normally, but it is excluded from
All Posts.
model.py | 18 ++++++++++++------
1 file changed, 12 insertions(+), 6 deletions(-)
diff --git a/model.py b/model.py
index 2ddf23b..ac89e72 100644
--- a/model.py
+++ b/model.py
@@ -1467,12 +1467,16 @@ class Database:
(fol.type={FOLLOW_SUBSPACE} AND fol.target=p.subspace) OR
(fol.type={FOLLOW_USER} AND fol.target=p.user))
"""
LEFT JOIN mute mt
ON mt.user=? AND
((mt.type={MUTE_POST} AND mt.target=p.id) OR
(mt.type={MUTE_SUBSPACE} AND mt.target=p.subspace) OR
(mt.type={MUTE_USER} AND mt.target=p.user))
((mt.type={MUTE_SUBSPACE} AND mt.target=p.subspace) OR
(mt.type={MUTE_USER} AND mt.target=p.user))
LEFT JOIN mute mt
ON mt.user=? AND
(mt.type={MUTE_USER} AND mt.target=p.user)
"""
TAG_FILTER_JOIN = "JOIN tags tg ON tg.post=p.id"
@@ -1489,7 +1493,8 @@ class Database:
filter = Database.FOLLOW_FILTER_JOIN
values.append(filter_by_followed.id)
if muted_by_user_id:
filter += Database.MUTE_COND_JOIN
filter += Database.MUTE_ALL_COND_JOIN if subspace is None \
else Database.MUTE_SUBSPACE_COND_JOIN
values.append(muted_by_user_id)
if filter_tag:
filter += Database.TAG_FILTER_JOIN
@@ -1632,7 +1637,8 @@ class Database:
filter = Database.FOLLOW_FILTER_JOIN
values.append(filter_by_followed.id)
if muted_by_user_id:
filter += Database.MUTE_COND_JOIN
filter += Database.MUTE_ALL_COND_JOIN if subspace is None \
else Database.MUTE_SUBSPACE_COND_JOIN
values.append(muted_by_user_id)
cond.append('mt.user IS NULL')
if filter_tag:
--
2.25.1
text/plain
This content has been proxied by September (3851b).