AP audience (visibility) パースの修正 (#5783)

* Refactor audience

* audienceのないAP Object 対応

* fix

* Update src/remote/activitypub/audience.ts

Co-Authored-By: Acid Chicken (硫酸鶏) <root@acid-chicken.com>

* Update src/remote/activitypub/audience.ts

Co-Authored-By: Acid Chicken (硫酸鶏) <root@acid-chicken.com>

Co-authored-by: Acid Chicken (硫酸鶏) <root@acid-chicken.com>
Co-authored-by: syuilo <Syuilotan@yahoo.co.jp>
This commit is contained in:
MeiMei
2020-01-30 18:58:13 +09:00
committed by GitHub
parent f6987c72ac
commit 711aa564c1
5 changed files with 123 additions and 68 deletions

View File

@@ -1,13 +1,13 @@
import Resolver from '../../resolver';
import { IRemoteUser } from '../../../../models/entities/user';
import { createNote, fetchNote } from '../../models/note';
import { getApId, IObject } from '../../type';
import { getApId, IObject, ICreate } from '../../type';
import { getApLock } from '../../../../misc/app-lock';
/**
* 投稿作成アクティビティを捌きます
*/
export default async function(resolver: Resolver, actor: IRemoteUser, note: IObject, silent = false): Promise<void> {
export default async function(resolver: Resolver, actor: IRemoteUser, note: IObject, silent = false, activity?: ICreate): Promise<void> {
const uri = getApId(note);
const unlock = await getApLock(uri);
@@ -15,7 +15,7 @@ export default async function(resolver: Resolver, actor: IRemoteUser, note: IObj
try {
const exist = await fetchNote(note);
if (exist == null) {
await createNote(note);
await createNote(note, resolver, silent, activity);
}
} finally {
unlock();