mirror of
https://codeberg.org/yeentown/barkey.git
synced 2025-05-19 20:26:56 +00:00
* 第3インスタンスへのLikeも受け入れるように * リアクション済みだったらエラーにせずに置き換えるように * Likeを第3インスタンスにdeliverするように * fix * fix * 同じリアクションがすでにされていたら何もしない * リモートから自身の投稿へリアクションした場合にエラーにならないように
17 lines
536 B
TypeScript
17 lines
536 B
TypeScript
import { IRemoteUser } from '../../../../models/entities/user';
|
|
import { ILike, getApId } from '../../type';
|
|
import deleteReaction from '../../../../services/note/reaction/delete';
|
|
import { fetchNote } from '../../models/note';
|
|
|
|
/**
|
|
* Process Undo.Like activity
|
|
*/
|
|
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}`;
|
|
|
|
await deleteReaction(actor, note);
|
|
return `ok`;
|
|
};
|