mirror of
https://github.com/NodeBB/NodeBB.git
synced 2025-10-26 08:36:12 +01:00
fix: #13202, private note assertion failure when cc property is missing
This commit is contained in:
@@ -64,7 +64,7 @@ inbox.create = async (req) => {
|
||||
const { object } = req.body;
|
||||
|
||||
// Alternative logic for non-public objects
|
||||
const isPublic = [...object.to, ...object.cc].includes(activitypub._constants.publicAddress);
|
||||
const isPublic = [...(object.to || []), ...(object.cc || [])].includes(activitypub._constants.publicAddress);
|
||||
if (!isPublic) {
|
||||
return await activitypub.notes.assertPrivate(object);
|
||||
}
|
||||
|
||||
@@ -234,7 +234,7 @@ Notes.assertPrivate = async (object) => {
|
||||
}
|
||||
|
||||
const localUids = [];
|
||||
const recipients = new Set([...object.to, ...object.cc]);
|
||||
const recipients = new Set([...(object.to || []), ...(object.cc || [])]);
|
||||
await Promise.all(Array.from(recipients).map(async (value) => {
|
||||
const { type, id } = await activitypub.helpers.resolveLocalId(value);
|
||||
if (type === 'user') {
|
||||
|
||||
Reference in New Issue
Block a user