mirror of
https://github.com/versia-pub/server.git
synced 2026-03-13 13:59:16 +01:00
refactor(federation): ♻️ Move incoming federation handling to custom class
This commit is contained in:
parent
d570e8c200
commit
f26493140f
9 changed files with 1066 additions and 622 deletions
|
|
@ -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;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue