accept the follow activity not the user
This commit is contained in:
parent
d2b9db4499
commit
58268ba6a1
|
@ -75,7 +75,7 @@ export const handleInboxPost = async (req: Request, res: Response) => {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
await sendAccept(actor, follower.id, follower.inbox);
|
await sendAccept(actor, activity.id, follower.id, follower.inbox);
|
||||||
|
|
||||||
await addFollower(actor.id, follower.id, follower.preferredUsername, follower.name, follower.inbox, follower.endpoints?.sharedInbox);
|
await addFollower(actor.id, follower.id, follower.preferredUsername, follower.name, follower.inbox, follower.endpoints?.sharedInbox);
|
||||||
|
|
||||||
|
@ -187,7 +187,7 @@ export const createArticleObject = (article: Article, nickname: string) => {
|
||||||
return obj;
|
return obj;
|
||||||
};
|
};
|
||||||
|
|
||||||
export const sendAccept = async (user: User, follower: string, inbox: string) => {
|
export const sendAccept = async (user: User, followId: string, follower: string, inbox: string) => {
|
||||||
const actor = fillRoute("actor", user.nickname);
|
const actor = fillRoute("actor", user.nickname);
|
||||||
|
|
||||||
const activity = {
|
const activity = {
|
||||||
|
@ -196,7 +196,7 @@ export const sendAccept = async (user: User, follower: string, inbox: string) =>
|
||||||
type: "Accept",
|
type: "Accept",
|
||||||
actor,
|
actor,
|
||||||
to: [follower],
|
to: [follower],
|
||||||
object: follower
|
object: followId
|
||||||
};
|
};
|
||||||
|
|
||||||
const payload = JSON.stringify(activity, null, 4);
|
const payload = JSON.stringify(activity, null, 4);
|
||||||
|
|
Loading…
Reference in New Issue