Skip to content

Node.js based forum software built for the modern web

fix: timestamp calculation

Julian Lam6a11c89b90cf
diff --git a/src/activitypub/inbox.js b/src/activitypub/inbox.js
index 2425aea057..cb5fa19a35 100644
--- a/src/activitypub/inbox.js
+++ b/src/activitypub/inbox.js
@@ -73,9 +73,7 @@ inbox.like = async (req) => {
inbox.announce = async (req) => {
const { actor, object, published, to, cc } = req.body;
let timestamp = new Date(published);
- if (timestamp.toString() === 'Invalid Date') {
- timestamp = Date.now();
- }
+ timestamp = timestamp.toString() !== 'Invalid Date' ? timestamp.getTime() : Date.now();
const assertion = await activitypub.actors.assert(actor);
if (!assertion) {