server/classes/functions/federation.ts

17 lines
448 B
TypeScript
Raw Normal View History

import type { Unfollow } from "@versia/federation/types";
import type { User } from "~/packages/database-interface/user";
2024-04-10 07:51:00 +02:00
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(),
};
};