summaryrefslogtreecommitdiff
path: root/src/remote/activitypub/renderer/follow-user.ts
blob: 744361a24f7babcbbc30a4c2f75de8e1c4adceaf (plain)
1
2
3
4
5
6
7
8
9
10
11
12
import config from '@/config';
import { Users } from '../../../models';
import { User } from '../../../models/entities/user';

/**
 * Convert (local|remote)(Follower|Followee)ID to URL
 * @param id Follower|Followee ID
 */
export default async function renderFollowUser(id: User['id']): Promise<any> {
	const user = await Users.findOneOrFail(id);
	return Users.isLocalUser(user) ? `${config.url}/users/${user.id}` : user.uri;
}