mirror of
https://github.com/NodeBB/NodeBB.git
synced 2026-02-12 09:37:35 +01:00
fix: have notes.assert call out.announce.topic only if uid is set (so, if note assertion is called via search; manual pull)
This commit is contained in:
@@ -55,7 +55,6 @@ Feps.announce = async function announce(id, activity) {
|
|||||||
|
|
||||||
if (activity.type === 'Create') {
|
if (activity.type === 'Create') {
|
||||||
const isMain = await posts.isMain(localId || id);
|
const isMain = await posts.isMain(localId || id);
|
||||||
console.log('plain announce', activity);
|
|
||||||
if (isMain) {
|
if (isMain) {
|
||||||
activitypub.helpers.log(`[activitypub/inbox.announce(1b12)] Announcing plain object (${activity.id}) to followers of cid ${cid} and ${relays.length} relays`);
|
activitypub.helpers.log(`[activitypub/inbox.announce(1b12)] Announcing plain object (${activity.id}) to followers of cid ${cid} and ${relays.length} relays`);
|
||||||
await activitypub.send('cid', localCid ? cid : 0, targets, {
|
await activitypub.send('cid', localCid ? cid : 0, targets, {
|
||||||
@@ -70,7 +69,6 @@ Feps.announce = async function announce(id, activity) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
activitypub.helpers.log(`[activitypub/inbox.announce(1b12)] Announcing ${activity.type} (${activity.id}) to followers of cid ${cid} and ${relays.length} relays`);
|
activitypub.helpers.log(`[activitypub/inbox.announce(1b12)] Announcing ${activity.type} (${activity.id}) to followers of cid ${cid} and ${relays.length} relays`);
|
||||||
console.log('activity announce', activity);
|
|
||||||
await activitypub.send('cid', localCid ? cid : 0, targets, {
|
await activitypub.send('cid', localCid ? cid : 0, targets, {
|
||||||
id: `${nconf.get('url')}/post/${encodeURIComponent(id)}#activity/announce/${now}`,
|
id: `${nconf.get('url')}/post/${encodeURIComponent(id)}#activity/announce/${now}`,
|
||||||
type: 'Announce',
|
type: 'Announce',
|
||||||
|
|||||||
@@ -265,8 +265,8 @@ Notes.assert = async (uid, input, options = { skipChecks: false }) => {
|
|||||||
|
|
||||||
await Notes.syncUserInboxes(tid, uid);
|
await Notes.syncUserInboxes(tid, uid);
|
||||||
|
|
||||||
if (!hasTid && options.cid) {
|
if (!hasTid && uid && options.cid) {
|
||||||
// New topic, have category announce it
|
// New topic via search/post-redirect, have category announce it
|
||||||
activitypub.out.announce.topic(tid);
|
activitypub.out.announce.topic(tid);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user