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:
Julian Lam
2024-12-03 11:59:55 -05:00
parent f32184b23e
commit 1839388b65
5 changed files with 11 additions and 7 deletions

View File

@@ -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;