mirror of
https://github.com/NodeBB/NodeBB.git
synced 2025-10-26 08:36:12 +01:00
fix: add try..catch wrapper around Announce(Like) call to internal method so as to not return a 500 — just drop the Like activity
This commit is contained in:
@@ -294,9 +294,13 @@ inbox.announce = async (req) => {
|
|||||||
const { id: localId } = await activitypub.helpers.resolveLocalId(id);
|
const { id: localId } = await activitypub.helpers.resolveLocalId(id);
|
||||||
const exists = await posts.exists(localId || id);
|
const exists = await posts.exists(localId || id);
|
||||||
if (exists) {
|
if (exists) {
|
||||||
const result = await posts.upvote(localId || id, object.actor);
|
try {
|
||||||
if (localId) {
|
const result = await posts.upvote(localId || id, object.actor);
|
||||||
socketHelpers.upvote(result, 'notifications:upvoted-your-post-in');
|
if (localId) {
|
||||||
|
socketHelpers.upvote(result, 'notifications:upvoted-your-post-in');
|
||||||
|
}
|
||||||
|
} catch (e) {
|
||||||
|
// vote denied due to local limitations (frequency, privilege, etc.); noop.
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user