server/classes/functions/federation.ts
2024-08-26 19:06:49 +02:00

17 lines
448 B
TypeScript

import type { Unfollow } from "@versia/federation/types";
import type { User } from "~/packages/database-interface/user";
export const unfollowFederationRequest = (
unfollower: User,
unfollowing: User,
): Unfollow => {
const id = crypto.randomUUID();
return {
type: "Unfollow",
id,
author: unfollower.getUri(),
created_at: new Date().toISOString(),
followee: unfollowing.getUri(),
};
};