mirror of
https://github.com/NodeBB/NodeBB.git
synced 2026-06-23 04:40:04 +02:00
feat: activitypub response to note retrieval via pid
This commit is contained in:
@@ -6,7 +6,7 @@ const activitypub = require('../activitypub');
|
||||
const utils = require('../utils');
|
||||
|
||||
const intFields = [
|
||||
'uid', 'pid', 'tid', 'deleted', 'timestamp',
|
||||
'uid', 'pid', 'tid', 'toPid', 'deleted', 'timestamp',
|
||||
'upvotes', 'downvotes', 'deleterUid', 'edited',
|
||||
'replies', 'bookmarks',
|
||||
];
|
||||
@@ -63,6 +63,9 @@ function modifyPost(post, fields) {
|
||||
intFields.splice(intFields.indexOf('uid'), 1);
|
||||
intFields.splice(intFields.indexOf('tid'), 1);
|
||||
}
|
||||
if (activitypub.helpers.isUri(post.toPid)) {
|
||||
intFields.splice(intFields.indexOf('toPid'), 1);
|
||||
}
|
||||
db.parseIntFields(post, intFields, fields);
|
||||
if (post.hasOwnProperty('upvotes') && post.hasOwnProperty('downvotes')) {
|
||||
post.votes = post.upvotes - post.downvotes;
|
||||
|
||||
Reference in New Issue
Block a user