mirror of
https://github.com/NodeBB/NodeBB.git
synced 2025-10-26 16:46:12 +01:00
feat: handle Undo(Flag)
This commit is contained in:
@@ -358,6 +358,21 @@ inbox.undo = async (req) => {
|
|||||||
}
|
}
|
||||||
|
|
||||||
notifications.rescind(`announce:post:${id}:uid:${actor}`);
|
notifications.rescind(`announce:post:${id}:uid:${actor}`);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
case 'Flag': {
|
||||||
|
if (!Array.isArray(object.object)) {
|
||||||
|
object.object = [object.object];
|
||||||
|
}
|
||||||
|
await Promise.all(object.object.map(async (subject) => {
|
||||||
|
const { type, id } = await activitypub.helpers.resolveLocalId(subject.id);
|
||||||
|
try {
|
||||||
|
await flags.rescindReport(type, id, actor);
|
||||||
|
} catch (e) {
|
||||||
|
reject('Undo', { type: 'Flag', object: [subject] }, actor);
|
||||||
|
}
|
||||||
|
}));
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|||||||
Reference in New Issue
Block a user