mirror of
https://github.com/NodeBB/NodeBB.git
synced 2025-10-26 16:46:12 +01:00
fix: preserve cid if set
This commit is contained in:
@@ -3,6 +3,7 @@
|
|||||||
const winston = require('winston');
|
const winston = require('winston');
|
||||||
|
|
||||||
const db = require('../database');
|
const db = require('../database');
|
||||||
|
const topics = require('../topics');
|
||||||
const posts = require('../posts');
|
const posts = require('../posts');
|
||||||
|
|
||||||
const activitypub = module.parent.exports;
|
const activitypub = module.parent.exports;
|
||||||
@@ -99,6 +100,8 @@ Notes.assertTopic = async (uid, id) => {
|
|||||||
return tid;
|
return tid;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const cid = await topics.getTopicField(tid, 'cid');
|
||||||
|
|
||||||
const unprocessed = chain.filter((p, idx) => !members[idx]);
|
const unprocessed = chain.filter((p, idx) => !members[idx]);
|
||||||
winston.info(`[notes/assertTopic] ${unprocessed.length} new note(s) found.`);
|
winston.info(`[notes/assertTopic] ${unprocessed.length} new note(s) found.`);
|
||||||
|
|
||||||
@@ -111,7 +114,7 @@ Notes.assertTopic = async (uid, id) => {
|
|||||||
db.setObject(`topicRemote:${tid}`, {
|
db.setObject(`topicRemote:${tid}`, {
|
||||||
tid,
|
tid,
|
||||||
uid: authorId,
|
uid: authorId,
|
||||||
cid: -1,
|
cid: cid || -1,
|
||||||
mainPid: tid,
|
mainPid: tid,
|
||||||
title: 'TBD',
|
title: 'TBD',
|
||||||
slug: `remote?resource=${encodeURIComponent(tid)}`,
|
slug: `remote?resource=${encodeURIComponent(tid)}`,
|
||||||
|
|||||||
Reference in New Issue
Block a user