diff --git a/CHANGELOG.md b/CHANGELOG.md index 79fd227220408db86054e5ee89a88b95f36fbe83..157c895072956126eeb9b16a47ff7ee6b3acf035 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,7 @@ ChangeLog unreleased ------------------- ### ðŸ›Fixes +* タイムラインã«è‡ªåˆ†ã®è¿”ä¿¡ã¨è‡ªåˆ†ã¸ã®è¿”ä¿¡ã¨æŠ•ç¨¿è€…自身ã¸ã®è¿”信以外ã®è¿”ä¿¡ãŒå«ã¾ã‚Œã¦ã„ã‚‹å•é¡Œã‚’ä¿®æ£ * グループãŒãªã„状態ã§ã‚°ãƒ«ãƒ¼ãƒ—ãƒãƒ£ãƒƒãƒˆã‚’開始ã—よã†ã¨ã™ã‚‹ã¨ãƒ•ãƒªãƒ¼ã‚ºã™ã‚‹å•é¡Œã‚’ä¿®æ£ 12.8.0 (2020/02/13) diff --git a/src/server/api/endpoints/notes/global-timeline.ts b/src/server/api/endpoints/notes/global-timeline.ts index 8654cf889a42ef1e05627dc21160f0a26d34bdc8..15f495576caf9ae88c4b6a4ca0a6808080d2f956 100644 --- a/src/server/api/endpoints/notes/global-timeline.ts +++ b/src/server/api/endpoints/notes/global-timeline.ts @@ -7,6 +7,7 @@ import { makePaginationQuery } from '../../common/make-pagination-query'; import { Notes } from '../../../../models'; import { generateMuteQuery } from '../../common/generate-mute-query'; import { activeUsersChart } from '../../../../services/chart'; +import { Brackets } from 'typeorm'; export const meta = { desc: { @@ -77,6 +78,18 @@ export default define(meta, async (ps, user) => { ps.sinceId, ps.untilId, ps.sinceDate, ps.untilDate) .andWhere('note.visibility = \'public\'') .andWhere('note.replyId IS NULL') + .andWhere(new Brackets(qb => { qb + .where(`note.replyId IS NULL`) // 返信ã§ã¯ãªã„ + .orWhere('note.replyUserId = :meId', { meId: user.id }) // 返信ã ã‘ã©è‡ªåˆ†ã®ãƒŽãƒ¼ãƒˆã¸ã®è¿”ä¿¡ + .orWhere(new Brackets(qb => { qb // 返信ã ã‘ã©è‡ªåˆ†ã®è¡Œã£ãŸè¿”ä¿¡ + .where(`note.replyId IS NOT NULL`) + .andWhere('note.userId = :meId', { meId: user.id }); + })) + .orWhere(new Brackets(qb => { qb // 返信ã ã‘ã©æŠ•ç¨¿è€…自身ã¸ã®è¿”ä¿¡ + .where(`note.replyId IS NOT NULL`) + .andWhere('note.replyUserId = note.userId', { meId: user.id }); + })); + })) .leftJoinAndSelect('note.user', 'user'); if (user) generateMuteQuery(query, user); diff --git a/src/server/api/endpoints/notes/hybrid-timeline.ts b/src/server/api/endpoints/notes/hybrid-timeline.ts index 4d0ac2fed0d097c431e090e46e5453270fc94ec0..4ff8e65e30e65e0e3266b04b3a479a1d5076398e 100644 --- a/src/server/api/endpoints/notes/hybrid-timeline.ts +++ b/src/server/api/endpoints/notes/hybrid-timeline.ts @@ -124,6 +124,18 @@ export default define(meta, async (ps, user) => { qb.where(`((note.userId IN (${ followingQuery.getQuery() })) OR (note.userId = :meId))`, { meId: user.id }) .orWhere('(note.visibility = \'public\') AND (note.userHost IS NULL)'); })) + .andWhere(new Brackets(qb => { qb + .where(`note.replyId IS NULL`) // 返信ã§ã¯ãªã„ + .orWhere('note.replyUserId = :meId', { meId: user.id }) // 返信ã ã‘ã©è‡ªåˆ†ã®ãƒŽãƒ¼ãƒˆã¸ã®è¿”ä¿¡ + .orWhere(new Brackets(qb => { qb // 返信ã ã‘ã©è‡ªåˆ†ã®è¡Œã£ãŸè¿”ä¿¡ + .where(`note.replyId IS NOT NULL`) + .andWhere('note.userId = :meId', { meId: user.id }); + })) + .orWhere(new Brackets(qb => { qb // 返信ã ã‘ã©æŠ•ç¨¿è€…自身ã¸ã®è¿”ä¿¡ + .where(`note.replyId IS NOT NULL`) + .andWhere('note.replyUserId = note.userId', { meId: user.id }); + })); + })) .leftJoinAndSelect('note.user', 'user') .setParameters(followingQuery.getParameters()); diff --git a/src/server/api/endpoints/notes/local-timeline.ts b/src/server/api/endpoints/notes/local-timeline.ts index 9fae40ecb683501a043fc5d40a0099e601dd2386..71ebceb0ec6dd4ceae2d55952b35c14cfccbc97c 100644 --- a/src/server/api/endpoints/notes/local-timeline.ts +++ b/src/server/api/endpoints/notes/local-timeline.ts @@ -93,6 +93,18 @@ export default define(meta, async (ps, user) => { const query = makePaginationQuery(Notes.createQueryBuilder('note'), ps.sinceId, ps.untilId, ps.sinceDate, ps.untilDate) .andWhere('(note.visibility = \'public\') AND (note.userHost IS NULL)') + .andWhere(new Brackets(qb => { qb + .where(`note.replyId IS NULL`) // 返信ã§ã¯ãªã„ + .orWhere('note.replyUserId = :meId', { meId: user.id }) // 返信ã ã‘ã©è‡ªåˆ†ã®ãƒŽãƒ¼ãƒˆã¸ã®è¿”ä¿¡ + .orWhere(new Brackets(qb => { qb // 返信ã ã‘ã©è‡ªåˆ†ã®è¡Œã£ãŸè¿”ä¿¡ + .where(`note.replyId IS NOT NULL`) + .andWhere('note.userId = :meId', { meId: user.id }); + })) + .orWhere(new Brackets(qb => { qb // 返信ã ã‘ã©æŠ•ç¨¿è€…自身ã¸ã®è¿”ä¿¡ + .where(`note.replyId IS NOT NULL`) + .andWhere('note.replyUserId = note.userId', { meId: user.id }); + })); + })) .leftJoinAndSelect('note.user', 'user'); generateVisibilityQuery(query, user); diff --git a/src/server/api/endpoints/notes/timeline.ts b/src/server/api/endpoints/notes/timeline.ts index b2fb250c537c3ee1940f5835ee4e11bd87ee9d01..1cf8cc4d18848b653d25102341fcb616e790c2be 100644 --- a/src/server/api/endpoints/notes/timeline.ts +++ b/src/server/api/endpoints/notes/timeline.ts @@ -110,6 +110,18 @@ export default define(meta, async (ps, user) => { .where(`note.userId IN (${ followingQuery.getQuery() })`) .orWhere('note.userId = :meId', { meId: user.id }); })) + .andWhere(new Brackets(qb => { qb + .where(`note.replyId IS NULL`) // 返信ã§ã¯ãªã„ + .orWhere('note.replyUserId = :meId', { meId: user.id }) // 返信ã ã‘ã©è‡ªåˆ†ã®ãƒŽãƒ¼ãƒˆã¸ã®è¿”ä¿¡ + .orWhere(new Brackets(qb => { qb // 返信ã ã‘ã©è‡ªåˆ†ã®è¡Œã£ãŸè¿”ä¿¡ + .where(`note.replyId IS NOT NULL`) + .andWhere('note.userId = :meId', { meId: user.id }); + })) + .orWhere(new Brackets(qb => { qb // 返信ã ã‘ã©æŠ•ç¨¿è€…自身ã¸ã®è¿”ä¿¡ + .where(`note.replyId IS NOT NULL`) + .andWhere('note.replyUserId = note.userId', { meId: user.id }); + })); + })) .leftJoinAndSelect('note.user', 'user') .setParameters(followingQuery.getParameters()); diff --git a/src/server/api/stream/channels/global-timeline.ts b/src/server/api/stream/channels/global-timeline.ts index 1271aae3a2c7b4215e32bec2b9f86f9547a3d0f4..a3ecf8e70625c7ab84e70892d549e00ae130f03d 100644 --- a/src/server/api/stream/channels/global-timeline.ts +++ b/src/server/api/stream/channels/global-timeline.ts @@ -38,6 +38,12 @@ export default class extends Channel { }); } + // 関係ãªã„返信ã¯é™¤å¤– + if (note.reply) { + // 「ãƒãƒ£ãƒ³ãƒãƒ«æŽ¥ç¶šä¸»ã¸ã®è¿”ä¿¡ã€ã§ã‚‚ãªã‘ã‚Œã°ã€ã€Œãƒãƒ£ãƒ³ãƒãƒ«æŽ¥ç¶šä¸»ãŒè¡Œã£ãŸè¿”ä¿¡ã€ã§ã‚‚ãªã‘ã‚Œã°ã€ã€ŒæŠ•ç¨¿è€…ã®æŠ•ç¨¿è€…自身ã¸ã®è¿”ä¿¡ã€ã§ã‚‚ãªã„å ´åˆ + if (note.reply.userId !== this.user!.id && note.userId !== this.user!.id && note.reply.userId !== note.userId) return; + } + // æµã‚Œã¦ããŸNoteãŒãƒŸãƒ¥ãƒ¼ãƒˆã—ã¦ã„るユーザーãŒé–¢ã‚ã‚‹ã‚‚ã®ã ã£ãŸã‚‰ç„¡è¦–ã™ã‚‹ if (shouldMuteThisNote(note, this.muting)) return; diff --git a/src/server/api/stream/channels/home-timeline.ts b/src/server/api/stream/channels/home-timeline.ts index 9aa4dc1c0f72881d12e814dbd8ef484c238ad714..3cf57c294cb276a6942a9f83cb7da0197590ba2a 100644 --- a/src/server/api/stream/channels/home-timeline.ts +++ b/src/server/api/stream/channels/home-timeline.ts @@ -43,6 +43,12 @@ export default class extends Channel { } } + // 関係ãªã„返信ã¯é™¤å¤– + if (note.reply) { + // 「ãƒãƒ£ãƒ³ãƒãƒ«æŽ¥ç¶šä¸»ã¸ã®è¿”ä¿¡ã€ã§ã‚‚ãªã‘ã‚Œã°ã€ã€Œãƒãƒ£ãƒ³ãƒãƒ«æŽ¥ç¶šä¸»ãŒè¡Œã£ãŸè¿”ä¿¡ã€ã§ã‚‚ãªã‘ã‚Œã°ã€ã€ŒæŠ•ç¨¿è€…ã®æŠ•ç¨¿è€…自身ã¸ã®è¿”ä¿¡ã€ã§ã‚‚ãªã„å ´åˆ + if (note.reply.userId !== this.user!.id && note.userId !== this.user!.id && note.reply.userId !== note.userId) return; + } + // æµã‚Œã¦ããŸNoteãŒãƒŸãƒ¥ãƒ¼ãƒˆã—ã¦ã„るユーザーãŒé–¢ã‚ã‚‹ã‚‚ã®ã ã£ãŸã‚‰ç„¡è¦–ã™ã‚‹ if (shouldMuteThisNote(note, this.muting)) return; diff --git a/src/server/api/stream/channels/hybrid-timeline.ts b/src/server/api/stream/channels/hybrid-timeline.ts index e32f4111c29668e9f1e32b9e44993408edf85140..40686f4b28241f81c1bc00a0b6dd1f026d6995b8 100644 --- a/src/server/api/stream/channels/hybrid-timeline.ts +++ b/src/server/api/stream/channels/hybrid-timeline.ts @@ -52,6 +52,12 @@ export default class extends Channel { } } + // 関係ãªã„返信ã¯é™¤å¤– + if (note.reply) { + // 「ãƒãƒ£ãƒ³ãƒãƒ«æŽ¥ç¶šä¸»ã¸ã®è¿”ä¿¡ã€ã§ã‚‚ãªã‘ã‚Œã°ã€ã€Œãƒãƒ£ãƒ³ãƒãƒ«æŽ¥ç¶šä¸»ãŒè¡Œã£ãŸè¿”ä¿¡ã€ã§ã‚‚ãªã‘ã‚Œã°ã€ã€ŒæŠ•ç¨¿è€…ã®æŠ•ç¨¿è€…自身ã¸ã®è¿”ä¿¡ã€ã§ã‚‚ãªã„å ´åˆ + if (note.reply.userId !== this.user!.id && note.userId !== this.user!.id && note.reply.userId !== note.userId) return; + } + // æµã‚Œã¦ããŸNoteãŒãƒŸãƒ¥ãƒ¼ãƒˆã—ã¦ã„るユーザーãŒé–¢ã‚ã‚‹ã‚‚ã®ã ã£ãŸã‚‰ç„¡è¦–ã™ã‚‹ if (shouldMuteThisNote(note, this.muting)) return; diff --git a/src/server/api/stream/channels/local-timeline.ts b/src/server/api/stream/channels/local-timeline.ts index e31e5c59cb68cb6497367ef5626c15a2f2397df1..4b7f74e4f7abb30d184510abbb9ad0ceaf8a7213 100644 --- a/src/server/api/stream/channels/local-timeline.ts +++ b/src/server/api/stream/channels/local-timeline.ts @@ -40,6 +40,12 @@ export default class extends Channel { }); } + // 関係ãªã„返信ã¯é™¤å¤– + if (note.reply) { + // 「ãƒãƒ£ãƒ³ãƒãƒ«æŽ¥ç¶šä¸»ã¸ã®è¿”ä¿¡ã€ã§ã‚‚ãªã‘ã‚Œã°ã€ã€Œãƒãƒ£ãƒ³ãƒãƒ«æŽ¥ç¶šä¸»ãŒè¡Œã£ãŸè¿”ä¿¡ã€ã§ã‚‚ãªã‘ã‚Œã°ã€ã€ŒæŠ•ç¨¿è€…ã®æŠ•ç¨¿è€…自身ã¸ã®è¿”ä¿¡ã€ã§ã‚‚ãªã„å ´åˆ + if (note.reply.userId !== this.user!.id && note.userId !== this.user!.id && note.reply.userId !== note.userId) return; + } + // æµã‚Œã¦ããŸNoteãŒãƒŸãƒ¥ãƒ¼ãƒˆã—ã¦ã„るユーザーãŒé–¢ã‚ã‚‹ã‚‚ã®ã ã£ãŸã‚‰ç„¡è¦–ã™ã‚‹ if (shouldMuteThisNote(note, this.muting)) return;