mirror of
https://iceshrimp.dev/limepotato/jormungandr-bite.git
synced 2024-11-26 03:47:40 -07:00
Fix #4731
This commit is contained in:
parent
5dc7cdeba6
commit
df3c05c6fb
2 changed files with 6 additions and 2 deletions
|
@ -2,11 +2,15 @@ import { User } from '../../../models/entities/user';
|
|||
import { Mutings } from '../../../models';
|
||||
import { SelectQueryBuilder, Brackets } from 'typeorm';
|
||||
|
||||
export function generateMuteQuery(q: SelectQueryBuilder<any>, me: User) {
|
||||
export function generateMuteQuery(q: SelectQueryBuilder<any>, me: User, exclude?: User) {
|
||||
const mutingQuery = Mutings.createQueryBuilder('muting')
|
||||
.select('muting.muteeId')
|
||||
.where('muting.muterId = :muterId', { muterId: me.id });
|
||||
|
||||
if (exclude) {
|
||||
mutingQuery.andWhere('muting.muteeId != :excludeId', { excludeId: exclude.id });
|
||||
}
|
||||
|
||||
// 投稿の作者をミュートしていない かつ
|
||||
// 投稿の返信先の作者をミュートしていない かつ
|
||||
// 投稿の引用元の作者をミュートしていない
|
||||
|
|
|
@ -134,7 +134,7 @@ export default define(meta, async (ps, me) => {
|
|||
.leftJoinAndSelect('note.user', 'user');
|
||||
|
||||
if (me) generateVisibilityQuery(query, me);
|
||||
if (me) generateMuteQuery(query, me);
|
||||
if (me) generateMuteQuery(query, me, user);
|
||||
|
||||
if (ps.withFiles) {
|
||||
query.andWhere('note.fileIds != \'{}\'');
|
||||
|
|
Loading…
Reference in a new issue