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,20 @@
import block from "../../../../services/blocking/create.js";
import DbResolver from "../../db-resolver.js";
import { Users } from "../../../../models/index.js";
export default (async (actor, activity)=>{
// ※ There is a block target in activity.object, which should be a local user that exists.
const dbResolver = new DbResolver();
const blockee = await dbResolver.getUserFromApId(activity.object);
if (blockee == null) {
return "skip: blockee not found";
}
if (blockee.host != null) {
return "skip: The user you are trying to block is not a local user";
}
await block(await Users.findOneByOrFail({
id: actor.id
}), await Users.findOneByOrFail({
id: blockee.id
}));
return "ok";
});