blob: b25f80aedcb179718eb7414b5fba0532e87f9ed4 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
|
import { IRemoteUser } from '../../../models/entities/user';
import { ILike, getApId } from '../type';
import create from '../../../services/note/reaction/create';
import { fetchNote } from '../models/note';
export default async (actor: IRemoteUser, activity: ILike) => {
const targetUri = getApId(activity.object);
const note = await fetchNote(targetUri);
if (!note) return `skip: target note not found ${targetUri}`;
if (actor.id === note.userId) return `skip: cannot react to my note`;
await create(actor, note, activity._misskey_reaction || activity.content || activity.name);
return `ok`;
};
|