From 5ffe6115740cfa293322e1961e7c9996e32ce2a4 Mon Sep 17 00:00:00 2001 From: Darius Kazemi Date: Mon, 6 Jan 2020 23:29:24 -0800 Subject: move function to activitypub file --- activitypub.js | 15 +++++++++++++++ 1 file changed, 15 insertions(+) (limited to 'activitypub.js') diff --git a/activitypub.js b/activitypub.js index 5940ac0..983738b 100644 --- a/activitypub.js +++ b/activitypub.js @@ -884,6 +884,20 @@ function processInbox(req, res) { } } +function createWebfinger(eventID, domain) { + return { + 'subject': `acct:${eventID}@${domain}`, + + 'links': [ + { + 'rel': 'self', + 'type': 'application/activity+json', + 'href': `https://${domain}/${eventID}` + } + ] + }; +} + module.exports = { processInbox, sendAcceptMessage, @@ -898,4 +912,5 @@ module.exports = { createActivityPubEvent, updateActivityPubEvent, createFeaturedPost, + createWebfinger, } -- cgit v1.2.3