This commit is contained in:
nelle 2024-08-26 12:04:20 -06:00
parent 9f79a2918b
commit 9bce59d985

View file

@ -144,6 +144,18 @@ export async function createNote(
logger.debug(`Note fetched: ${JSON.stringify(note, null, 2)}`);
logger.info(`Creating the Note: ${note.id}`);
// Skip if note is made before 2007 (1yr before Fedi was created)
// OR skip if note is made 3 days in advance
if (note.published) {
const DateChecker = new Date(note.published);
const FutureCheck = new Date();
FutureCheck.setDate(FutureCheck.getDate() + 3); // Allow some wiggle room for misconfigured hosts
if (DateChecker > FutureCheck) {
logger.warn("Note somehow made after today; discarding");
return null;
}
}
// Fetch author
const actor = (await resolvePerson(
getOneApId(note.attributedTo),