Fixed 267U.pre2

This commit is contained in:
2026-07-26 18:25:37 +09:00
parent 50bfaeafdf
commit 317d00a284
1286 changed files with 80222 additions and 1 deletions
@@ -0,0 +1,17 @@
import { fetchNote } from "../../models/note.js";
import { removePinned } from "../../../../services/i/pin.js";
export default (async (actor, activity)=>{
if ("actor" in activity && actor.uri !== activity.actor) {
throw new Error("invalid actor");
}
if (activity.target == null) {
throw new Error("target is null");
}
if (activity.target === actor.featured) {
const note = await fetchNote(activity.object);
if (note == null) return "skip: note not found"; // not pinned either way
await removePinned(actor, note.id);
return "ok";
}
throw new Error(`unknown target: ${activity.target}`);
});