mirror of
https://github.com/NodeBB/NodeBB.git
synced 2025-10-26 16:46:12 +01:00
fix: timestamp calculation
This commit is contained in:
@@ -73,9 +73,7 @@ inbox.like = async (req) => {
|
|||||||
inbox.announce = async (req) => {
|
inbox.announce = async (req) => {
|
||||||
const { actor, object, published, to, cc } = req.body;
|
const { actor, object, published, to, cc } = req.body;
|
||||||
let timestamp = new Date(published);
|
let timestamp = new Date(published);
|
||||||
if (timestamp.toString() === 'Invalid Date') {
|
timestamp = timestamp.toString() !== 'Invalid Date' ? timestamp.getTime() : Date.now();
|
||||||
timestamp = Date.now();
|
|
||||||
}
|
|
||||||
|
|
||||||
const assertion = await activitypub.actors.assert(actor);
|
const assertion = await activitypub.actors.assert(actor);
|
||||||
if (!assertion) {
|
if (!assertion) {
|
||||||
|
|||||||
Reference in New Issue
Block a user