feat: actor cache, method to resolve inboxes, stub code for sending requests. Now base64 encoding digest as expected by Mastodon

This commit is contained in:
Julian Lam
2023-06-23 14:59:47 -04:00
parent 2e89900886
commit cdc4275fec
5 changed files with 87 additions and 27 deletions

View File

@@ -2,7 +2,7 @@
const nconf = require('nconf');
const user = require('../user');
const user = require('../../user');
const activitypub = require('../../activitypub');
const Controller = module.exports;
@@ -103,3 +103,24 @@ Controller.postInbox = async (req, res) => {
res.sendStatus(201);
};
/**
* Main ActivityPub verbs
*/
Controller.follow = async (req, res) => {
await activitypub.send(req.uid, req.params.uid, {
type: 'Follow',
object: {
type: 'Person',
name: req.params.uid,
},
});
res.sendStatus(201);
};
Controller.unfollow = async (req, res) => {
console.log('got here');
res.sendStatus(201);
};