Merge branch 'develop' of https://github.com/misskey-dev/misskey into develop

This commit is contained in:
NoriDev 2023-07-06 19:36:34 +09:00
commit b0df25d28b
9 changed files with 52 additions and 36 deletions

View file

@ -23,6 +23,7 @@
- Fix: sparkle内にリンクを入れるとクリック不能になる問題の修正
- deck UIのカラムのメニューからアンテナとリストの編集画面を開けるように
- ドライブファイルのメニューで画像をクロップできるように
- 画像を動画と同様に簡単に隠せるように
### Server
- JSON.parse の回数を削減することで、ストリーミングのパフォーマンスを向上しました

View file

@ -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
}

View file

@ -1,5 +1,4 @@
import { Inject, Injectable, OnApplicationShutdown } from '@nestjs/common';
import escapeRegexp from 'escape-regexp';
import { DI } from '@/di-symbols.js';
import type { MessagingMessagesRepository, NotesRepository, UserPublickeysRepository, UsersRepository } from '@/models/index.js';
import type { Config } from '@/config.js';
@ -60,25 +59,18 @@ export class ApDbResolverService implements OnApplicationShutdown {
@bindThis
public parseUri(value: string | IObject): UriParseResult {
const uri = getApId(value);
// the host part of a URL is case insensitive, so use the 'i' flag.
const localRegex = new RegExp('^' + escapeRegexp(this.config.url) + '/(\\w+)/(\\w+)(?:\/(.+))?', 'i');
const matchLocal = uri.match(localRegex);
if (matchLocal) {
return {
local: true,
type: matchLocal[1],
id: matchLocal[2],
rest: matchLocal[3],
};
} else {
return {
local: false,
uri,
};
}
const separator = '/';
const uri = new URL(getApId(value));
if (uri.origin !== this.config.url) return { local: false, uri: uri.href };
const [, type, id, ...rest] = uri.pathname.split(separator);
return {
local: true,
type,
id,
rest: rest.length === 0 ? undefined : rest.join(separator),
};
}
/**

View file

@ -47,4 +47,4 @@ html
header#banner(style=`background-image: url(${meta.bannerUrl})`)
div#title= meta.name || host
div#content
div#description= meta.description
div#description!= meta.description

View file

@ -110,7 +110,7 @@ function waitForDecode() {
.then(() => {
loaded = true;
}, error => {
console.error('Error occured during decoding image', img.value, error);
console.error('Error occurred during decoding image', img.value, error);
throw Error(error);
});
} else {
@ -182,7 +182,7 @@ async function draw() {
render(props.hash, work);
drawImage(work);
} catch (error) {
console.error('Error occured during drawing blurhash', error);
console.error('Error occurred during drawing blurhash', error);
}
}
}

View file

@ -33,6 +33,7 @@
<div v-if="image.isSensitive" :class="$style.indicator" style="color: var(--warn);">NSFW</div>
</div>
<button :class="$style.menu" class="_button" @click.stop="showMenu"><i class="ti ti-dots" style="vertical-align: middle;"></i></button>
<i class="ti ti-eye-off" :class="$style.hide" @click.stop="hide = true"></i>
</template>
</div>
</template>
@ -113,6 +114,21 @@ function showMenu(ev: MouseEvent) {
align-items: center;
}
.hide {
display: block;
position: absolute;
border-radius: 6px;
background-color: var(--fg);
color: var(--accentLighten);
font-size: 12px;
opacity: .5;
padding: 5px 8px;
text-align: center;
cursor: pointer;
top: 12px;
right: 12px;
}
.hiddenTextWrapper {
display: table-cell;
text-align: center;
@ -137,8 +153,8 @@ function showMenu(ev: MouseEvent) {
backdrop-filter: var(--blur, blur(15px));
color: #fff;
font-size: 0.8em;
width: 32px;
height: 32px;
width: 28px;
height: 28px;
text-align: center;
bottom: 10px;
right: 10px;

View file

@ -115,6 +115,8 @@ onMounted(() => {
imageClickAction: 'close',
tapAction: 'toggle-controls',
bgOpacity: 1,
showAnimationDuration: 100,
hideAnimationDuration: 100,
pswpModule: PhotoSwipe,
});

View file

@ -188,6 +188,7 @@ watch(queue, (a, b) => {
}, { deep: true });
async function init(): Promise<void> {
items.value = new Map();
queue.value = new Map();
fetching.value = true;
const params = props.pagination.params ? isRef(props.pagination.params) ? props.pagination.params.value : props.pagination.params : {};
@ -219,8 +220,6 @@ async function init(): Promise<void> {
}
const reload = (): Promise<void> => {
items.value = new Map();
queue.value = new Map();
return init();
};

View file

@ -251,6 +251,12 @@ const patronsWithIconWithMisskey = [{
}, {
name: 'spinlock',
icon: 'https://misskey-hub.net/patrons/6a1cebc819d540a78bf20e9e3115baa8.jpg',
}, {
name: 'じゅくま',
icon: 'https://misskey-hub.net/patrons/3e56bdac69dd42f7a06e0f12cf2fc895.jpg',
}, {
name: '清遊あみ',
icon: 'https://misskey-hub.net/patrons/de25195b88e940a388388bea2e7637d8.jpg',
}];
const patronsWithCherryPick = [