mirror of
https://github.com/misskey-dev/misskey.git
synced 2026-08-02 13:26:07 +00:00
deps(backend): update typeorm to v1 (#17476)
* deps(backend): update typeorm to v1 * fix * fix * attempt to fix test (to be reverted)) * Revert "attempt to fix test (to be reverted))" This reverts commit8adf2a1239. * attempt to fix test * Revert "attempt to fix test" This reverts commit4cf0f5ec9e. * attempt to fix test * fix * fix
This commit is contained in:
@@ -321,7 +321,11 @@ export class NoteCreateService implements OnApplicationShutdown {
|
||||
// Fetch renote to note
|
||||
renote = await this.notesRepository.findOne({
|
||||
where: { id: data.renoteId },
|
||||
relations: ['user', 'renote', 'reply'],
|
||||
relations: {
|
||||
user: true,
|
||||
renote: true,
|
||||
reply: true,
|
||||
},
|
||||
});
|
||||
|
||||
if (renote == null) {
|
||||
@@ -370,14 +374,14 @@ export class NoteCreateService implements OnApplicationShutdown {
|
||||
// Fetch reply
|
||||
reply = await this.notesRepository.findOne({
|
||||
where: { id: data.replyId },
|
||||
relations: ['user'],
|
||||
relations: { user: true },
|
||||
});
|
||||
|
||||
if (reply == null) {
|
||||
throw new IdentifiableError('60142edb-1519-408e-926d-4f108d27bee0', 'No such reply target');
|
||||
} else if (isRenote(reply) && !isQuote(reply)) {
|
||||
throw new IdentifiableError('f089e4e2-c0e7-4f60-8a23-e5a6bf786b36', 'Cannot reply to pure renote');
|
||||
} else if (!await this.noteEntityService.isVisibleForMe(reply, user.id)) {
|
||||
} else if (!(await this.noteEntityService.isVisibleForMe(reply, user.id))) {
|
||||
throw new IdentifiableError('11cd37b3-a411-4f77-8633-c580ce6a8dce', 'No such reply target');
|
||||
} else if (reply.visibility === 'specified' && data.visibility !== 'specified') {
|
||||
throw new IdentifiableError('ced780a1-2012-4caf-bc7e-a95a291294cb', 'Cannot reply to specified note with different visibility');
|
||||
@@ -572,7 +576,7 @@ export class NoteCreateService implements OnApplicationShutdown {
|
||||
|
||||
emojis = data.apEmojis ?? extractCustomEmojisFromMfm(combinedTokens);
|
||||
|
||||
mentionedUsers = data.apMentions ?? await this.extractMentionedUsers(user, combinedTokens);
|
||||
mentionedUsers = data.apMentions ?? (await this.extractMentionedUsers(user, combinedTokens));
|
||||
}
|
||||
|
||||
// if the host is media-silenced, custom emojis are not allowed
|
||||
@@ -1050,7 +1054,7 @@ export class NoteCreateService implements OnApplicationShutdown {
|
||||
where: {
|
||||
followeeId: note.channelId,
|
||||
},
|
||||
select: ['followerId'],
|
||||
select: { followerId: true },
|
||||
});
|
||||
|
||||
for (const channelFollowing of channelFollowings) {
|
||||
@@ -1069,13 +1073,20 @@ export class NoteCreateService implements OnApplicationShutdown {
|
||||
followerHost: IsNull(),
|
||||
isFollowerHibernated: false,
|
||||
},
|
||||
select: ['followerId', 'withReplies'],
|
||||
select: {
|
||||
followerId: true,
|
||||
withReplies: true,
|
||||
},
|
||||
}),
|
||||
this.userListMembershipsRepository.find({
|
||||
where: {
|
||||
userId: user.id,
|
||||
},
|
||||
select: ['userListId', 'userListUserId', 'withReplies'],
|
||||
select: {
|
||||
userListId: true,
|
||||
userListUserId: true,
|
||||
withReplies: true,
|
||||
},
|
||||
}),
|
||||
]);
|
||||
|
||||
@@ -1183,7 +1194,7 @@ export class NoteCreateService implements OnApplicationShutdown {
|
||||
id: In(samples.map(x => x.followerId)),
|
||||
lastActiveDate: LessThan(new Date(Date.now() - (1000 * 60 * 60 * 24 * 50))),
|
||||
},
|
||||
select: ['id'],
|
||||
select: { id: true },
|
||||
});
|
||||
|
||||
if (hibernatedUsers.length > 0) {
|
||||
|
||||
Reference in New Issue
Block a user