mirror of
https://github.com/NodeBB/NodeBB.git
synced 2026-01-06 07:40:43 +01:00
fix: persist sourceContent into post hash when ingesting remote posts, update markdown so that field is parsed instead of ignoring content
This commit is contained in:
@@ -16,7 +16,7 @@ const isEmojiShortcode = /^:[\w]+:$/;
|
||||
module.exports = function (Posts) {
|
||||
Posts.create = async function (data) {
|
||||
// This is an internal method, consider using Topics.reply instead
|
||||
const { uid, tid, _activitypub } = data;
|
||||
const { uid, tid, _activitypub, sourceContent } = data;
|
||||
const content = data.content.toString();
|
||||
const timestamp = data.timestamp || Date.now();
|
||||
const isMain = data.isMain || false;
|
||||
@@ -30,7 +30,7 @@ module.exports = function (Posts) {
|
||||
}
|
||||
|
||||
const pid = data.pid || await db.incrObjectField('global', 'nextPid');
|
||||
let postData = { pid, uid, tid, content, timestamp };
|
||||
let postData = { pid, uid, tid, content, sourceContent, timestamp };
|
||||
|
||||
if (data.toPid) {
|
||||
postData.toPid = data.toPid;
|
||||
|
||||
Reference in New Issue
Block a user