mirror of
https://github.com/misskey-dev/misskey.git
synced 2025-01-27 03:31:37 +09:00
cleanup(ApNoteService.ts
)
This commit is contained in:
parent
42b90cd2f1
commit
7a825752f5
@ -294,19 +294,18 @@ export class ApNoteService {
|
|||||||
const uri = typeof value === 'string' ? value : value.id;
|
const uri = typeof value === 'string' ? value : value.id;
|
||||||
if (uri == null) throw new Error('missing uri');
|
if (uri == null) throw new Error('missing uri');
|
||||||
|
|
||||||
// ブロックしてたら中断
|
// ブロックしていたら中断
|
||||||
const meta = await this.metaService.fetch();
|
const meta = await this.metaService.fetch();
|
||||||
if (this.utilityService.isBlockedHost(meta.blockedHosts, this.utilityService.extractDbHost(uri))) throw new StatusError('blocked host', 451);
|
if (this.utilityService.isBlockedHost(meta.blockedHosts, this.utilityService.extractDbHost(uri))) {
|
||||||
|
throw new StatusError('blocked host', 451);
|
||||||
|
}
|
||||||
|
|
||||||
const unlock = await this.appLockService.getApLock(uri);
|
const unlock = await this.appLockService.getApLock(uri);
|
||||||
|
|
||||||
try {
|
try {
|
||||||
//#region このサーバーに既に登録されていたらそれを返す
|
//#region このサーバーに既に登録されていたらそれを返す
|
||||||
const exist = await this.fetchNote(uri);
|
const exist = await this.fetchNote(uri);
|
||||||
|
if (exist) return exist;
|
||||||
if (exist) {
|
|
||||||
return exist;
|
|
||||||
}
|
|
||||||
//#endregion
|
//#endregion
|
||||||
|
|
||||||
if (uri.startsWith(this.config.url)) {
|
if (uri.startsWith(this.config.url)) {
|
||||||
|
Loading…
Reference in New Issue
Block a user