mirror of
				https://codeberg.org/yeentown/barkey.git
				synced 2025-11-03 23:14:13 +00:00 
			
		
		
		
	
							parent
							
								
									7fd8ef344b
								
							
						
					
					
						commit
						77ebabb3dc
					
				
					 2 changed files with 11 additions and 12 deletions
				
			
		| 
						 | 
					@ -16,13 +16,23 @@ import { bindThis } from '@/decorators.js';
 | 
				
			||||||
import { DebounceLoader } from '@/misc/loader.js';
 | 
					import { DebounceLoader } from '@/misc/loader.js';
 | 
				
			||||||
import { IdService } from '@/core/IdService.js';
 | 
					import { IdService } from '@/core/IdService.js';
 | 
				
			||||||
import { ReactionsBufferingService } from '@/core/ReactionsBufferingService.js';
 | 
					import { ReactionsBufferingService } from '@/core/ReactionsBufferingService.js';
 | 
				
			||||||
import { isPureRenote } from '@/misc/is-renote.js';
 | 
					 | 
				
			||||||
import type { OnModuleInit } from '@nestjs/common';
 | 
					import type { OnModuleInit } from '@nestjs/common';
 | 
				
			||||||
import type { CustomEmojiService } from '../CustomEmojiService.js';
 | 
					import type { CustomEmojiService } from '../CustomEmojiService.js';
 | 
				
			||||||
import type { ReactionService } from '../ReactionService.js';
 | 
					import type { ReactionService } from '../ReactionService.js';
 | 
				
			||||||
import type { UserEntityService } from './UserEntityService.js';
 | 
					import type { UserEntityService } from './UserEntityService.js';
 | 
				
			||||||
import type { DriveFileEntityService } from './DriveFileEntityService.js';
 | 
					import type { DriveFileEntityService } from './DriveFileEntityService.js';
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					function isPureRenote(note: MiNote): note is MiNote & { renoteId: MiNote['id']; renote: MiNote } {
 | 
				
			||||||
 | 
						return (
 | 
				
			||||||
 | 
							note.renote != null &&
 | 
				
			||||||
 | 
							note.reply == null &&
 | 
				
			||||||
 | 
							note.text == null &&
 | 
				
			||||||
 | 
							note.cw == null &&
 | 
				
			||||||
 | 
							(note.fileIds == null || note.fileIds.length === 0) &&
 | 
				
			||||||
 | 
							!note.hasPoll
 | 
				
			||||||
 | 
						);
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
function getAppearNoteIds(notes: MiNote[]): Set<string> {
 | 
					function getAppearNoteIds(notes: MiNote[]): Set<string> {
 | 
				
			||||||
	const appearNoteIds = new Set<string>();
 | 
						const appearNoteIds = new Set<string>();
 | 
				
			||||||
	for (const note of notes) {
 | 
						for (const note of notes) {
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -36,17 +36,6 @@ export function isQuote(note: Renote): note is Quote {
 | 
				
			||||||
		note.fileIds.length > 0;
 | 
							note.fileIds.length > 0;
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
export function isPureRenote(note: MiNote): note is MiNote & { renoteId: MiNote['id']; renote: MiNote } {
 | 
					 | 
				
			||||||
	return (
 | 
					 | 
				
			||||||
		note.renote != null &&
 | 
					 | 
				
			||||||
		note.reply == null &&
 | 
					 | 
				
			||||||
		note.text == null &&
 | 
					 | 
				
			||||||
		note.cw == null &&
 | 
					 | 
				
			||||||
		(note.fileIds == null || note.fileIds.length === 0) &&
 | 
					 | 
				
			||||||
		!note.hasPoll
 | 
					 | 
				
			||||||
	);
 | 
					 | 
				
			||||||
}
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
type PackedRenote =
 | 
					type PackedRenote =
 | 
				
			||||||
	Packed<'Note'> & {
 | 
						Packed<'Note'> & {
 | 
				
			||||||
		renoteId: NonNullable<Packed<'Note'>['renoteId']>
 | 
							renoteId: NonNullable<Packed<'Note'>['renoteId']>
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
	Add table
		
		Reference in a new issue