mirror of
https://github.com/NodeBB/NodeBB.git
synced 2025-11-02 20:16:04 +01:00
@@ -212,6 +212,18 @@ Mocks.actors.category = async (cid) => {
|
||||
|
||||
Mocks.note = async (post) => {
|
||||
const id = `${nconf.get('url')}/post/${post.pid}`;
|
||||
|
||||
// Return a tombstone for a deleted post
|
||||
if (post.deleted === true) {
|
||||
return Mocks.tombstone({
|
||||
id,
|
||||
formerType: 'Note',
|
||||
attributedTo: `${nconf.get('url')}/uid/${post.user.uid}`,
|
||||
context: `${nconf.get('url')}/topic/${post.topic.tid}`,
|
||||
audience: `${nconf.get('url')}/category/${post.category.cid}`,
|
||||
});
|
||||
}
|
||||
|
||||
const published = new Date(parseInt(post.timestamp, 10)).toISOString();
|
||||
|
||||
// todo: post visibility
|
||||
@@ -341,3 +353,9 @@ Mocks.note = async (post) => {
|
||||
|
||||
return object;
|
||||
};
|
||||
|
||||
Mocks.tombstone = async properties => ({
|
||||
'@context': 'https://www.w3.org/ns/activitystreams',
|
||||
type: 'Tombstone',
|
||||
...properties,
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user