enhance(server): Improve user block (#7640)
* enhance(server): Improve user block
* Update CHANGELOG.md
* ユーザーリスト対応
* 相手から見れなくなるように
* Update 1629004542760-chart-reindex.ts
2365761ba5 (commitcomment-54919821)
* update test
* add test
* add todos
* Update 1629004542760-chart-reindex.ts
This commit is contained in:
parent
7ebdd4739a
commit
7015df37e3
42 changed files with 394 additions and 30 deletions
|
|
@ -16,7 +16,7 @@ import { extractMentions } from '@/misc/extract-mentions';
|
|||
import { extractCustomEmojisFromMfm } from '@/misc/extract-custom-emojis-from-mfm';
|
||||
import { extractHashtags } from '@/misc/extract-hashtags';
|
||||
import { Note, IMentionedRemoteUsers } from '../../models/entities/note';
|
||||
import { Mutings, Users, NoteWatchings, Notes, Instances, UserProfiles, Antennas, Followings, MutedNotes, Channels, ChannelFollowings } from '../../models';
|
||||
import { Mutings, Users, NoteWatchings, Notes, Instances, UserProfiles, Antennas, Followings, MutedNotes, Channels, ChannelFollowings, Blockings } from '../../models';
|
||||
import { DriveFile } from '../../models/entities/drive-file';
|
||||
import { App } from '../../models/entities/app';
|
||||
import { Not, getConnection, In } from 'typeorm';
|
||||
|
|
@ -265,8 +265,10 @@ export default async (user: { id: User['id']; username: User['username']; host:
|
|||
.andWhere(`following.followeeId = :userId`, { userId: note.userId })
|
||||
.getMany()
|
||||
.then(async followings => {
|
||||
const blockings = await Blockings.find({ blockerId: user.id }); // TODO: キャッシュしたい
|
||||
const followers = followings.map(f => f.followerId);
|
||||
for (const antenna of (await getAntennas())) {
|
||||
if (blockings.some(blocking => blocking.blockeeId === antenna.userId)) continue; // この処理は checkHitAntenna 内でやるようにしてもいいかも
|
||||
checkHitAntenna(antenna, note, user, followers).then(hit => {
|
||||
if (hit) {
|
||||
addNoteToAntenna(antenna, note, user);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue