mirror of
https://github.com/dariusk/express-activitypub.git
synced 2024-11-22 07:11:00 +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) {
|
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();
|
let d = new Date();
|
||||||
|
|
||||||
return {
|
return {
|
||||||
'@context': 'https://www.w3.org/ns/activitystreams',
|
'@context': 'https://www.w3.org/ns/activitystreams',
|
||||||
|
|
||||||
'id': `https://${domain}/${guid}`,
|
'id': `https://${domain}/${guidCreate}`,
|
||||||
'type': 'Create',
|
'type': 'Create',
|
||||||
'actor': `https://${domain}/u/${name}`,
|
'actor': `https://${domain}/u/${name}`,
|
||||||
|
|
||||||
'object': {
|
'object': {
|
||||||
'id': `https://${domain}/${guid}`,
|
'id': `https://${domain}/${guidNote}`,
|
||||||
'type': 'Note',
|
'type': 'Note',
|
||||||
'published': d.toISOString(),
|
'published': d.toISOString(),
|
||||||
'attributedTo': `https://${domain}/u/${name}`,
|
'attributedTo': `https://${domain}/u/${name}`,
|
||||||
|
|
Loading…
Reference in a new issue