mirror of
				https://codeberg.org/yeentown/barkey.git
				synced 2025-11-03 23:14:13 +00:00 
			
		
		
		
	View MR for information: https://activitypub.software/TransFem-org/Sharkey/-/merge_requests/907 Closes #944 Approved-by: Charlotte <timo.herngreen@gmail.com> Approved-by: Hazelnoot <acomputerdog@gmail.com>
This commit is contained in:
		
						commit
						e5c41444e6
					
				
					 1 changed files with 14 additions and 11 deletions
				
			
		| 
						 | 
				
			
			@ -42,8 +42,14 @@ function getAppearNoteIds(notes: MiNote[]): Set<string> {
 | 
			
		|||
	for (const note of notes) {
 | 
			
		||||
		if (isPureRenote(note)) {
 | 
			
		||||
			appearNoteIds.add(note.renoteId);
 | 
			
		||||
			if (note.renote?.replyId) {
 | 
			
		||||
				appearNoteIds.add(note.renote.replyId);
 | 
			
		||||
			}
 | 
			
		||||
		} else {
 | 
			
		||||
			appearNoteIds.add(note.id);
 | 
			
		||||
			if (note.replyId) {
 | 
			
		||||
				appearNoteIds.add(note.replyId);
 | 
			
		||||
			}
 | 
			
		||||
		}
 | 
			
		||||
	}
 | 
			
		||||
	return appearNoteIds;
 | 
			
		||||
| 
						 | 
				
			
			@ -272,7 +278,9 @@ export class NoteEntityService implements OnModuleInit {
 | 
			
		|||
			const reaction = _hint_.myReactions.get(note.id);
 | 
			
		||||
			if (reaction) {
 | 
			
		||||
				return this.reactionService.convertLegacyReaction(reaction);
 | 
			
		||||
			} else {
 | 
			
		||||
			} else if (reaction === null) {
 | 
			
		||||
				// the hints explicitly say this note has no reactions from
 | 
			
		||||
				// this user
 | 
			
		||||
				return undefined;
 | 
			
		||||
			}
 | 
			
		||||
		}
 | 
			
		||||
| 
						 | 
				
			
			@ -525,9 +533,6 @@ export class NoteEntityService implements OnModuleInit {
 | 
			
		|||
		if (meId) {
 | 
			
		||||
			const idsNeedFetchMyReaction = new Set<MiNote['id']>();
 | 
			
		||||
 | 
			
		||||
			// パフォーマンスのためノートが作成されてから2秒以上経っていない場合はリアクションを取得しない
 | 
			
		||||
			const oldId = this.idService.gen(Date.now() - 2000);
 | 
			
		||||
 | 
			
		||||
			const targetNotes: MiNote[] = [];
 | 
			
		||||
			for (const note of notes) {
 | 
			
		||||
				if (isPureRenote(note)) {
 | 
			
		||||
| 
						 | 
				
			
			@ -537,15 +542,13 @@ export class NoteEntityService implements OnModuleInit {
 | 
			
		|||
						// idem if the renote is also a reply.
 | 
			
		||||
						targetNotes.push(note.renote.reply);
 | 
			
		||||
					}
 | 
			
		||||
				} else if (note.reply) {
 | 
			
		||||
					// idem for OP of a regular reply.
 | 
			
		||||
					targetNotes.push(note.reply);
 | 
			
		||||
				} else {
 | 
			
		||||
					if (note.id < oldId) {
 | 
			
		||||
						targetNotes.push(note);
 | 
			
		||||
					} else {
 | 
			
		||||
						myReactionsMap.set(note.id, null);
 | 
			
		||||
					if (note.reply) {
 | 
			
		||||
						// idem for OP of a regular reply.
 | 
			
		||||
						targetNotes.push(note.reply);
 | 
			
		||||
					}
 | 
			
		||||
 | 
			
		||||
					targetNotes.push(note);
 | 
			
		||||
				}
 | 
			
		||||
			}
 | 
			
		||||
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
	Add table
		
		Reference in a new issue