refactor(federation): ♻️ Move incoming federation handling to custom class

This commit is contained in:
Jesse Wierzbinski 2024-11-01 20:42:32 +01:00
parent d570e8c200
commit f26493140f
No known key found for this signature in database
9 changed files with 1066 additions and 622 deletions

View file

@ -111,20 +111,6 @@ export const getFromHeader = async (value: string): Promise<AuthData> => {
return { user, token, application };
};
export const sendFollowAccept = async (follower: User, followee: User) => {
await follower.federateToUser(
followAcceptToVersia(follower, followee),
followee,
);
};
export const sendFollowReject = async (follower: User, followee: User) => {
await follower.federateToUser(
followRejectToVersia(follower, followee),
followee,
);
};
export const transformOutputToUserWithRelations = (
user: Omit<UserType, "endpoints"> & {
followerCount: unknown;