mirror of
https://github.com/versia-pub/server.git
synced 2026-01-26 20:26:01 +01:00
Wrong order in follower acceptance
This commit is contained in:
parent
1a27be9542
commit
27a287ab4d
|
|
@ -628,16 +628,16 @@ export const followAcceptToLysand = (
|
||||||
follower: User,
|
follower: User,
|
||||||
followee: User,
|
followee: User,
|
||||||
): Lysand.FollowAccept => {
|
): Lysand.FollowAccept => {
|
||||||
if (follower.instanceId) {
|
if (!follower.instanceId) {
|
||||||
throw new Error("Follower must be a local user");
|
throw new Error("Follower must be a remote user");
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!followee.instanceId) {
|
if (followee.instanceId) {
|
||||||
throw new Error("Followee must be a remote user");
|
throw new Error("Followee must be a local user");
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!followee.uri) {
|
if (!follower.uri) {
|
||||||
throw new Error("Followee must have a URI in database");
|
throw new Error("Follower must have a URI in database");
|
||||||
}
|
}
|
||||||
|
|
||||||
const id = crypto.randomUUID();
|
const id = crypto.randomUUID();
|
||||||
|
|
@ -645,12 +645,9 @@ export const followAcceptToLysand = (
|
||||||
return {
|
return {
|
||||||
type: "FollowAccept",
|
type: "FollowAccept",
|
||||||
id: id,
|
id: id,
|
||||||
author: new URL(
|
author: getUserUri(followee),
|
||||||
`/users/${followee.id}`,
|
|
||||||
config.http.base_url,
|
|
||||||
).toString(),
|
|
||||||
created_at: new Date().toISOString(),
|
created_at: new Date().toISOString(),
|
||||||
follower: getUserUri(follower),
|
follower: follower.uri,
|
||||||
uri: new URL(`/follows/${id}`, config.http.base_url).toString(),
|
uri: new URL(`/follows/${id}`, config.http.base_url).toString(),
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue