mirror of
https://github.com/NodeBB/NodeBB.git
synced 2025-10-26 16:46:12 +01:00
@@ -11,6 +11,7 @@ const topics = require('../topics');
|
|||||||
const categories = require('../categories');
|
const categories = require('../categories');
|
||||||
const notifications = require('../notifications');
|
const notifications = require('../notifications');
|
||||||
const flags = require('../flags');
|
const flags = require('../flags');
|
||||||
|
const api = require('../api');
|
||||||
const activitypub = require('.');
|
const activitypub = require('.');
|
||||||
|
|
||||||
const socketHelpers = require('../socket.io/helpers');
|
const socketHelpers = require('../socket.io/helpers');
|
||||||
@@ -74,6 +75,10 @@ inbox.update = async (req) => {
|
|||||||
try {
|
try {
|
||||||
if (exists) {
|
if (exists) {
|
||||||
await posts.edit(postData);
|
await posts.edit(postData);
|
||||||
|
const isDeleted = await posts.getPostField(object.id, 'deleted');
|
||||||
|
if (isDeleted) {
|
||||||
|
await api.posts.restore({ uid: actor }, { pid: object.id });
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
await activitypub.notes.assert(0, object.id);
|
await activitypub.notes.assert(0, object.id);
|
||||||
}
|
}
|
||||||
@@ -87,6 +92,25 @@ inbox.update = async (req) => {
|
|||||||
await activitypub.actors.assert(object.id, { update: true });
|
await activitypub.actors.assert(object.id, { update: true });
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
case 'Tombstone': {
|
||||||
|
const [isNote, isActor] = await Promise.all([
|
||||||
|
posts.exists(object.id),
|
||||||
|
db.isSortedSetMember('usersRemote:lastCrawled', object.id),
|
||||||
|
]);
|
||||||
|
|
||||||
|
switch (true) {
|
||||||
|
case isNote: {
|
||||||
|
await api.posts.delete({ uid: actor }, { pid: object.id });
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
// case isActor: {
|
||||||
|
// console.log('actor');
|
||||||
|
// break;
|
||||||
|
// }
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user