monkeeShark/src/remote/activitypub/renderer/like.ts

11 lines
278 B
TypeScript
Raw Normal View History

2018-04-07 08:05:14 +00:00
import config from '../../../config';
2018-04-07 21:55:26 +00:00
import { ILocalUser } from '../../../models/user';
2018-04-07 08:05:14 +00:00
2018-04-07 21:55:26 +00:00
export default (user: ILocalUser, note) => {
2018-04-07 08:05:14 +00:00
return {
type: 'Like',
actor: `${config.url}/@${user.username}`,
2018-04-07 17:30:37 +00:00
object: note.uri ? note.uri : `${config.url}/notes/${note._id}`
2018-04-07 08:05:14 +00:00
};
};