mirror of
https://github.com/dariusk/express-activitypub.git
synced 2024-11-25 00:30:59 +00:00
parent
1cd377e351
commit
dadd959f23
1 changed files with 4 additions and 3 deletions
|
@ -63,18 +63,19 @@ function signAndSend(message, name, domain, req, res, targetDomain, inbox) {
|
|||
}
|
||||
|
||||
function createMessage(text, name, domain) {
|
||||
const guid = crypto.randomBytes(16).toString('hex');
|
||||
const guidCreate = crypto.randomBytes(16).toString('hex');
|
||||
const guidNote = crypto.randomBytes(16).toString('hex');
|
||||
let d = new Date();
|
||||
|
||||
return {
|
||||
'@context': 'https://www.w3.org/ns/activitystreams',
|
||||
|
||||
'id': `https://${domain}/${guid}`,
|
||||
'id': `https://${domain}/${guidCreate}`,
|
||||
'type': 'Create',
|
||||
'actor': `https://${domain}/u/${name}`,
|
||||
|
||||
'object': {
|
||||
'id': `https://${domain}/${guid}`,
|
||||
'id': `https://${domain}/${guidNote}`,
|
||||
'type': 'Note',
|
||||
'published': d.toISOString(),
|
||||
'attributedTo': `https://${domain}/u/${name}`,
|
||||
|
|
Loading…
Reference in a new issue