mirror of
https://iceshrimp.dev/crimekillz/iceshrimp-161sh.git
synced 2024-11-24 21:19:07 +01:00
[backend] We don't need to check for visibility if we already filter for public posts only
This commit is contained in:
parent
6bc42c2a9b
commit
eff0f32dc1
@ -88,7 +88,8 @@ export default define(meta, paramDef, async (ps, user) => {
|
||||
ps.sinceDate,
|
||||
ps.untilDate,
|
||||
)
|
||||
.andWhere("(note.visibility = 'public') AND (note.userHost IS NULL)")
|
||||
.andWhere("note.visibility = 'public'")
|
||||
.andWhere("note.userHost IS NULL")
|
||||
.innerJoinAndSelect("note.user", "user")
|
||||
.leftJoinAndSelect("user.avatar", "avatar")
|
||||
.leftJoinAndSelect("user.banner", "banner")
|
||||
@ -103,7 +104,6 @@ export default define(meta, paramDef, async (ps, user) => {
|
||||
|
||||
generateChannelQuery(query, user);
|
||||
generateRepliesQuery(query, ps.withReplies, user);
|
||||
generateVisibilityQuery(query, user);
|
||||
if (user) generateMutedUserQuery(query, user);
|
||||
if (user) generateMutedNoteQuery(query, user);
|
||||
if (user) generateBlockedUserQuery(query, user);
|
||||
@ -133,7 +133,6 @@ export default define(meta, paramDef, async (ps, user) => {
|
||||
);
|
||||
}
|
||||
}
|
||||
query.andWhere("note.visibility != 'hidden'");
|
||||
//#endregion
|
||||
|
||||
process.nextTick(() => {
|
||||
|
@ -88,10 +88,8 @@ export default define(meta, paramDef, async (ps, user) => {
|
||||
ps.sinceDate,
|
||||
ps.untilDate,
|
||||
)
|
||||
.andWhere(
|
||||
`(note.userHost = ANY ('{"${m.recommendedInstances.join('","')}"}'))`,
|
||||
)
|
||||
.andWhere("(note.visibility = 'public')")
|
||||
.andWhere(`note.userHost IN (:...instances)`, { instances: m.recommendedInstances })
|
||||
.andWhere("note.visibility = 'public'")
|
||||
.innerJoinAndSelect("note.user", "user")
|
||||
.leftJoinAndSelect("user.avatar", "avatar")
|
||||
.leftJoinAndSelect("user.banner", "banner")
|
||||
@ -106,7 +104,6 @@ export default define(meta, paramDef, async (ps, user) => {
|
||||
|
||||
generateChannelQuery(query, user);
|
||||
generateRepliesQuery(query, ps.withReplies, user);
|
||||
generateVisibilityQuery(query, user);
|
||||
if (user) generateMutedUserQuery(query, user);
|
||||
if (user) generateMutedNoteQuery(query, user);
|
||||
if (user) generateBlockedUserQuery(query, user);
|
||||
@ -136,7 +133,6 @@ export default define(meta, paramDef, async (ps, user) => {
|
||||
);
|
||||
}
|
||||
}
|
||||
query.andWhere("note.visibility != 'hidden'");
|
||||
//#endregion
|
||||
|
||||
process.nextTick(() => {
|
||||
|
Loading…
Reference in New Issue
Block a user