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:
parent
f6987c72ac
commit
711aa564c1
5 changed files with 123 additions and 68 deletions
|
|
@ -19,7 +19,7 @@ export default async (actor: IRemoteUser, activity: ICreate): Promise<void> => {
|
|||
});
|
||||
|
||||
if (validPost.includes(object.type)) {
|
||||
createNote(resolver, actor, object);
|
||||
createNote(resolver, actor, object, false, activity);
|
||||
} else {
|
||||
logger.warn(`Unknown type: ${object.type}`);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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();
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue