mirror of
https://github.com/NodeBB/NodeBB.git
synced 2025-11-03 20:45:58 +01:00
fix: missing awaits, more comprehensive 1b12 tests
This commit is contained in:
@@ -310,7 +310,15 @@ activitypubApi.delete.note = enabledCheck(async (caller, { pid }) => {
|
||||
activitypubApi.like = {};
|
||||
|
||||
activitypubApi.like.note = enabledCheck(async (caller, { pid }) => {
|
||||
if (!activitypub.helpers.isUri(pid)) { // remote only
|
||||
const payload = {
|
||||
id: `${nconf.get('url')}/uid/${caller.uid}#activity/like/${encodeURIComponent(pid)}`,
|
||||
type: 'Like',
|
||||
actor: `${nconf.get('url')}/uid/${caller.uid}`,
|
||||
object: utils.isNumber(pid) ? `${nconf.get('url')}/post/${pid}` : pid,
|
||||
};
|
||||
|
||||
if (!activitypub.helpers.isUri(pid)) { // only 1b12 announce for local likes
|
||||
await activitypub.feps.announce(pid, payload);
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -319,13 +327,6 @@ activitypubApi.like.note = enabledCheck(async (caller, { pid }) => {
|
||||
return;
|
||||
}
|
||||
|
||||
const payload = {
|
||||
id: `${nconf.get('url')}/uid/${caller.uid}#activity/like/${encodeURIComponent(pid)}`,
|
||||
type: 'Like',
|
||||
actor: `${nconf.get('url')}/uid/${caller.uid}`,
|
||||
object: pid,
|
||||
};
|
||||
|
||||
await Promise.all([
|
||||
activitypub.send('uid', caller.uid, [uid], payload),
|
||||
activitypub.feps.announce(pid, payload),
|
||||
|
||||
Reference in New Issue
Block a user