hippofish/src/remote/activitypub/kernel/create/note.ts
2018-04-09 05:02:52 +09:00

13 lines
415 B
TypeScript

import Resolver from '../../resolver';
import { IRemoteUser } from '../../../../models/user';
import { createNote, fetchNote } from '../../objects/note';
/**
* 投稿作成アクティビティを捌きます
*/
export default async function(resolver: Resolver, actor: IRemoteUser, note, silent = false): Promise<void> {
const exist = await fetchNote(note);
if (exist == null) {
await createNote(note);
}
}