mirror of
https://iceshrimp.dev/limepotato/jormungandr-bite.git
synced 2024-11-26 20:07:33 -07:00
get post details from object
This commit is contained in:
parent
db392efae8
commit
4df655126d
1 changed files with 3 additions and 3 deletions
|
@ -84,7 +84,7 @@ export async function importPosts(
|
||||||
for (const post of parsed.orderedItems) {
|
for (const post of parsed.orderedItems) {
|
||||||
try {
|
try {
|
||||||
linenum++;
|
linenum++;
|
||||||
if (post.inReplyTo != null) {
|
if (post.object.inReplyTo != null) {
|
||||||
logger.info(`Is reply, skip [${linenum}] ...`);
|
logger.info(`Is reply, skip [${linenum}] ...`);
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
@ -94,7 +94,7 @@ export async function importPosts(
|
||||||
}
|
}
|
||||||
let text;
|
let text;
|
||||||
try {
|
try {
|
||||||
text = htmlToMfm(post.content, post.tag);
|
text = htmlToMfm(post.object.content, post.object.tag);
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
logger.warn(`Error while parsing text in line ${linenum}: ${e}`);
|
logger.warn(`Error while parsing text in line ${linenum}: ${e}`);
|
||||||
continue;
|
continue;
|
||||||
|
@ -102,7 +102,7 @@ export async function importPosts(
|
||||||
logger.info(`Posting[${linenum}] ...`);
|
logger.info(`Posting[${linenum}] ...`);
|
||||||
|
|
||||||
const note = await create(user, {
|
const note = await create(user, {
|
||||||
createdAt: new Date(post.published),
|
createdAt: new Date(post.object.published),
|
||||||
files: undefined,
|
files: undefined,
|
||||||
poll: undefined,
|
poll: undefined,
|
||||||
text: text || undefined,
|
text: text || undefined,
|
||||||
|
|
Loading…
Reference in a new issue