monkeeShark/packages/backend/src/remote/activitypub/renderer/update.ts
syuilo 0e4a111f81 refactoring
Resolve #7779
2021-11-12 02:02:25 +09:00

15 lines
438 B
TypeScript

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;
};