Implement like
This commit is contained in:
9
src/remote/activitypub/renderer/like.ts
Normal file
9
src/remote/activitypub/renderer/like.ts
Normal file
@@ -0,0 +1,9 @@
|
||||
import config from '../../../config';
|
||||
|
||||
export default (user, post) => {
|
||||
return {
|
||||
type: 'Like',
|
||||
actor: `${config.url}/@${user.username}`,
|
||||
object: post.uri ? post.uri : `${config.url}/posts/${post._id}`
|
||||
};
|
||||
};
|
@@ -23,7 +23,7 @@ export default async (user: IUser, post: IPost) => {
|
||||
});
|
||||
|
||||
if (inReplyToUser !== null) {
|
||||
inReplyTo = inReplyToPost.uri || `${config.url}/@${inReplyToUser.username}/${inReplyToPost._id}`;
|
||||
inReplyTo = inReplyToPost.uri || `${config.url}/posts/${inReplyToPost._id}`;
|
||||
}
|
||||
}
|
||||
} else {
|
||||
@@ -33,7 +33,7 @@ export default async (user: IUser, post: IPost) => {
|
||||
const attributedTo = `${config.url}/@${user.username}`;
|
||||
|
||||
return {
|
||||
id: `${attributedTo}/${post._id}`,
|
||||
id: `${config.url}/posts/${post._id}`,
|
||||
type: 'Note',
|
||||
attributedTo,
|
||||
content: post.textHtml,
|
||||
|
Reference in New Issue
Block a user