feat: send back follow id in Accept

This commit is contained in:
Opliko
2024-04-10 00:30:46 +02:00
parent e0166cccb2
commit 66b0d81caf

View File

@@ -167,7 +167,7 @@ inbox.announce = async (req) => {
}; };
inbox.follow = async (req) => { inbox.follow = async (req) => {
const { actor, object } = req.body; const { actor, object, id: followId } = req.body;
// Sanity checks // Sanity checks
const { type, id } = await helpers.resolveLocalId(object.id); const { type, id } = await helpers.resolveLocalId(object.id);
if (!['category', 'user'].includes(type)) { if (!['category', 'user'].includes(type)) {
@@ -201,8 +201,10 @@ inbox.follow = async (req) => {
activitypub.send('uid', id, actor, { activitypub.send('uid', id, actor, {
type: 'Accept', type: 'Accept',
object: { object: {
id: followId,
type: 'Follow', type: 'Follow',
actor, actor,
object: object.id,
}, },
}); });
} else if (type === 'category') { } else if (type === 'category') {
@@ -225,6 +227,7 @@ inbox.follow = async (req) => {
activitypub.send('cid', id, actor, { activitypub.send('cid', id, actor, {
type: 'Accept', type: 'Accept',
object: { object: {
id: followId,
type: 'Follow', type: 'Follow',
actor, actor,
object: object.id, object: object.id,