Merge branch 'develop' into fetch-outbox
This commit is contained in:
commit
71d74676f0
27 changed files with 2822 additions and 2178 deletions
|
|
@ -304,11 +304,11 @@ export class FileInfoService {
|
|||
@bindThis
|
||||
public fixMime(mime: string | fileType.MimeType): string {
|
||||
// see https://github.com/misskey-dev/misskey/pull/10686
|
||||
if (mime === "audio/x-flac") {
|
||||
return "audio/flac";
|
||||
if (mime === 'audio/x-flac') {
|
||||
return 'audio/flac';
|
||||
}
|
||||
if (mime === "audio/vnd.wave") {
|
||||
return "audio/wav";
|
||||
if (mime === 'audio/vnd.wave') {
|
||||
return 'audio/wav';
|
||||
}
|
||||
|
||||
return mime;
|
||||
|
|
@ -355,11 +355,12 @@ export class FileInfoService {
|
|||
* Check the file is SVG or not
|
||||
*/
|
||||
@bindThis
|
||||
public async checkSvg(path: string) {
|
||||
public async checkSvg(path: string): Promise<boolean> {
|
||||
try {
|
||||
const size = await this.getFileSize(path);
|
||||
if (size > 1 * 1024 * 1024) return false;
|
||||
return isSvg(fs.readFileSync(path));
|
||||
const buffer = await fs.promises.readFile(path);
|
||||
return isSvg(buffer.toString());
|
||||
} catch {
|
||||
return false;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -121,10 +121,8 @@ export class NoteDeleteService {
|
|||
}
|
||||
|
||||
@bindThis
|
||||
private async findCascadingNotes(note: Note) {
|
||||
const cascadingNotes: Note[] = [];
|
||||
|
||||
const recursive = async (noteId: string) => {
|
||||
private async findCascadingNotes(note: Note): Promise<Note[]> {
|
||||
const recursive = async (noteId: string): Promise<Note[]> => {
|
||||
const query = this.notesRepository.createQueryBuilder('note')
|
||||
.where('note.replyId = :noteId', { noteId })
|
||||
.orWhere(new Brackets(q => {
|
||||
|
|
@ -133,12 +131,14 @@ export class NoteDeleteService {
|
|||
}))
|
||||
.leftJoinAndSelect('note.user', 'user');
|
||||
const replies = await query.getMany();
|
||||
for (const reply of replies) {
|
||||
cascadingNotes.push(reply);
|
||||
await recursive(reply.id);
|
||||
}
|
||||
|
||||
return [
|
||||
replies,
|
||||
...await Promise.all(replies.map(reply => recursive(reply.id))),
|
||||
].flat();
|
||||
};
|
||||
await recursive(note.id);
|
||||
|
||||
const cascadingNotes: Note[] = await recursive(note.id);
|
||||
|
||||
return cascadingNotes.filter(note => note.userHost === null); // filter out non-local users
|
||||
}
|
||||
|
|
|
|||
|
|
@ -35,7 +35,7 @@ html
|
|||
link(rel='prefetch' href=infoImageUrl)
|
||||
link(rel='prefetch' href=notFoundImageUrl)
|
||||
//- https://github.com/misskey-dev/misskey/issues/9842
|
||||
link(rel='stylesheet' href='/assets/tabler-icons/tabler-icons.min.css?v2.22.0')
|
||||
link(rel='stylesheet' href='/assets/tabler-icons/tabler-icons.min.css?v2.24.0')
|
||||
link(rel='modulepreload' href=`/vite/${clientEntry.file}`)
|
||||
|
||||
if !config.clientManifestExists
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue