diff options
author | Vika <vika@fireburn.ru> | 2024-08-23 18:24:31 +0300 |
---|---|---|
committer | Vika <vika@fireburn.ru> | 2024-08-23 18:24:31 +0300 |
commit | 22217993d1a0cba4d419ddf2867e1751df9248bc (patch) | |
tree | c1bb669e74036dbdcdb3bebbe6fd77d2a3edde0a /src/database/postgres | |
parent | b96e44f3526a6da09b5fd09617802190fa8fc134 (diff) | |
download | kittybox-22217993d1a0cba4d419ddf2867e1751df9248bc.tar.zst |
Fix private posts with no defined audience not being shown in feeds
Diffstat (limited to 'src/database/postgres')
-rw-r--r-- | src/database/postgres/mod.rs | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/src/database/postgres/mod.rs b/src/database/postgres/mod.rs index 3aef08e..1780672 100644 --- a/src/database/postgres/mod.rs +++ b/src/database/postgres/mod.rs @@ -373,9 +373,12 @@ WHERE ) OR ( - $3 != null AND ( - mf2['properties']['audience'] ? $3 - OR mf2['properties']['author'] ? $3 + $3 IS NOT NULL AND ( + (NOT (mf2['properties'] ? 'audience')) + OR + (mf2['properties']['audience'] ? $3) + OR + (mf2['properties']['author'] ? $3) ) ) ) @@ -385,7 +388,7 @@ LIMIT $2" ) .bind(url) .bind(limit as i64) - .bind(user.map(url::Url::to_string)) + .bind(user.map(url::Url::as_str)) .bind(cursor) .fetch_all(&mut *txn) .await |