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