Merge remote-tracking branch 'misskey-original/develop' into develop

This commit is contained in:
mattyatea 2023-10-07 08:00:28 +09:00
commit 320299cc53
2 changed files with 24 additions and 12 deletions

View File

@ -726,16 +726,20 @@ export class NoteCreateService implements OnApplicationShutdown {
.where('id = :id', { id: renote.id }) .where('id = :id', { id: renote.id })
.execute(); .execute();
// 30%の確率ハイライト用ランキング更新 // 30%の確率、3日以内に投稿されたートの場合ハイライト用ランキング更新
if (Math.random() < 0.3) { if (Math.random() < 0.3 && (Date.now() - this.idService.parse(renote.id).date.getTime()) < 1000 * 60 * 60 * 24 * 3) {
if (renote.channelId != null) { if (renote.channelId != null) {
if (renote.replyId == null) {
this.featuredService.updateInChannelNotesRanking(renote.channelId, renote.id, 5); this.featuredService.updateInChannelNotesRanking(renote.channelId, renote.id, 5);
} else if (renote.visibility === 'public' && renote.userHost == null) { }
} else {
if (renote.visibility === 'public' && renote.userHost == null && renote.replyId == null) {
this.featuredService.updateGlobalNotesRanking(renote.id, 5); this.featuredService.updateGlobalNotesRanking(renote.id, 5);
this.featuredService.updatePerUserNotesRanking(renote.userId, renote.id, 5); this.featuredService.updatePerUserNotesRanking(renote.userId, renote.id, 5);
} }
} }
} }
}
@bindThis @bindThis
private async createMentionedEvents(mentionedUsers: MinimumUser[], note: MiNote, nm: NotificationManager) { private async createMentionedEvents(mentionedUsers: MinimumUser[], note: MiNote, nm: NotificationManager) {

View File

@ -192,15 +192,23 @@ export class ReactionService {
.where('id = :id', { id: note.id }) .where('id = :id', { id: note.id })
.execute(); .execute();
// 30%の確率でハイライト用ランキング更新 // 30%の確率、セルフではない、3日以内に投稿されたートの場合ハイライト用ランキング更新
if (Math.random() < 0.3 && note.userId !== user.id) { if (
Math.random() < 0.3 &&
note.userId !== user.id &&
(Date.now() - this.idService.parse(note.id).date.getTime()) < 1000 * 60 * 60 * 24 * 3
) {
if (note.channelId != null) { if (note.channelId != null) {
if (note.replyId == null) {
this.featuredService.updateInChannelNotesRanking(note.channelId, note.id, 1); this.featuredService.updateInChannelNotesRanking(note.channelId, note.id, 1);
} else if (note.visibility === 'public' && note.userHost == null) { }
} else {
if (note.visibility === 'public' && note.userHost == null && note.replyId == null) {
this.featuredService.updateGlobalNotesRanking(note.id, 1); this.featuredService.updateGlobalNotesRanking(note.id, 1);
this.featuredService.updatePerUserNotesRanking(note.userId, note.id, 1); this.featuredService.updatePerUserNotesRanking(note.userId, note.id, 1);
} }
} }
}
const meta = await this.metaService.fetch(); const meta = await this.metaService.fetch();