mirror of
https://github.com/NodeBB/NodeBB.git
synced 2025-10-26 16:46:12 +01:00
fix: AP inbox update handling for non-note objects
This commit is contained in:
@@ -84,8 +84,8 @@ inbox.update = async (req) => {
|
|||||||
throw new Error('[[error:activitypub.origin-mismatch]]');
|
throw new Error('[[error:activitypub.origin-mismatch]]');
|
||||||
}
|
}
|
||||||
|
|
||||||
switch (object.type) {
|
switch (true) {
|
||||||
case 'Note': {
|
case activitypub._constants.acceptedPostTypes.includes(object.type): {
|
||||||
const [isNote, isMessage] = await Promise.all([
|
const [isNote, isMessage] = await Promise.all([
|
||||||
posts.exists(object.id),
|
posts.exists(object.id),
|
||||||
messaging.messageExists(object.id),
|
messaging.messageExists(object.id),
|
||||||
@@ -136,16 +136,12 @@ inbox.update = async (req) => {
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
case 'Application': // falls through
|
case activitypub._constants.acceptableActorTypes.has(object.type): {
|
||||||
case 'Group': // falls through
|
|
||||||
case 'Organization': // falls through
|
|
||||||
case 'Service': // falls through
|
|
||||||
case 'Person': {
|
|
||||||
await activitypub.actors.assert(object.id, { update: true });
|
await activitypub.actors.assert(object.id, { update: true });
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
case 'Tombstone': {
|
case object.type === 'Tombstone': {
|
||||||
const [isNote, isMessage/* , isActor */] = await Promise.all([
|
const [isNote, isMessage/* , isActor */] = await Promise.all([
|
||||||
posts.exists(object.id),
|
posts.exists(object.id),
|
||||||
messaging.messageExists(object.id),
|
messaging.messageExists(object.id),
|
||||||
|
|||||||
Reference in New Issue
Block a user