summaryrefslogtreecommitdiff
path: root/src/remote/activitypub/renderer/update.ts
blob: 8bb415d117c1fb6720ea215ba37f62e03417700c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
import config from '@/config/index';
import { User } from '@/models/entities/user';

export default (object: any, user: { id: User['id'] }) => {
	const activity = {
		id: `${config.url}/users/${user.id}#updates/${new Date().getTime()}`,
		actor: `${config.url}/users/${user.id}`,
		type: 'Update',
		to: [ 'https://www.w3.org/ns/activitystreams#Public' ],
		object,
		published: new Date().toISOString(),
	} as any;

	return activity;
};