mirror of
https://github.com/versia-pub/server.git
synced 2025-12-06 16:38:19 +01:00
Folreq fix
This commit is contained in:
parent
dbb96027b8
commit
f72671fb07
|
|
@ -71,6 +71,17 @@ export const followRequestUser = async (
|
|||
) => {
|
||||
const isRemote = follower.instanceId !== followee.instanceId;
|
||||
|
||||
const relationship = await client.relationship.update({
|
||||
where: { id: relationshipId },
|
||||
data: {
|
||||
following: isRemote ? false : !followee.isLocked,
|
||||
requested: isRemote ? true : followee.isLocked,
|
||||
showingReblogs: reblogs,
|
||||
notifying: notify,
|
||||
languages: languages,
|
||||
},
|
||||
});
|
||||
|
||||
if (isRemote) {
|
||||
// Federate
|
||||
// TODO: Make database job
|
||||
|
|
@ -85,9 +96,17 @@ export const followRequestUser = async (
|
|||
|
||||
if (!response.ok) {
|
||||
console.error(await response.text());
|
||||
throw new Error(
|
||||
console.error(
|
||||
`Failed to federate follow request from ${follower.id} to ${followee.uri}`,
|
||||
);
|
||||
|
||||
return await client.relationship.update({
|
||||
where: { id: relationshipId },
|
||||
data: {
|
||||
following: false,
|
||||
requested: false,
|
||||
},
|
||||
});
|
||||
}
|
||||
} else {
|
||||
if (followee.isLocked) {
|
||||
|
|
@ -109,17 +128,6 @@ export const followRequestUser = async (
|
|||
}
|
||||
}
|
||||
|
||||
const relationship = await client.relationship.update({
|
||||
where: { id: relationshipId },
|
||||
data: {
|
||||
following: isRemote ? false : !followee.isLocked,
|
||||
requested: isRemote ? true : followee.isLocked,
|
||||
showingReblogs: reblogs,
|
||||
notifying: notify,
|
||||
languages: languages,
|
||||
},
|
||||
});
|
||||
|
||||
return relationship;
|
||||
};
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue