mirror of
https://github.com/NodeBB/NodeBB.git
synced 2025-10-26 16:46:12 +01:00
feat: inbox and outbox routes, stub controllers
This commit is contained in:
@@ -39,3 +39,28 @@ Controller.getActor = async (req, res) => {
|
|||||||
},
|
},
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
|
Controller.getOutbox = async (req, res) => {
|
||||||
|
// stub
|
||||||
|
res.status(200).json({
|
||||||
|
'@context': 'https://www.w3.org/ns/activitystreams',
|
||||||
|
type: 'OrderedCollection',
|
||||||
|
totalItems: 0,
|
||||||
|
orderedItems: [],
|
||||||
|
});
|
||||||
|
};
|
||||||
|
|
||||||
|
Controller.postOutbox = async (req, res) => {
|
||||||
|
// This is a client-to-server feature so it is deliberately not implemented at this time.
|
||||||
|
res.sendStatus(405);
|
||||||
|
};
|
||||||
|
|
||||||
|
Controller.getInbox = async (req, res) => {
|
||||||
|
// This is a client-to-server feature so it is deliberately not implemented at this time.
|
||||||
|
res.sendStatus(405);
|
||||||
|
};
|
||||||
|
|
||||||
|
Controller.postInbox = async (req, res) => {
|
||||||
|
// stub — other activity-pub services will push stuff here.
|
||||||
|
res.sendStatus(405);
|
||||||
|
};
|
||||||
|
|||||||
@@ -4,4 +4,10 @@ module.exports = function (app, middleware, controllers) {
|
|||||||
const middlewares = [middleware.proceedOnActivityPub, middleware.exposeUid];
|
const middlewares = [middleware.proceedOnActivityPub, middleware.exposeUid];
|
||||||
|
|
||||||
app.get('/user/:userslug', middlewares, controllers.activitypub.getActor);
|
app.get('/user/:userslug', middlewares, controllers.activitypub.getActor);
|
||||||
|
|
||||||
|
app.get('/user/:userslug/outbox', middlewares, controllers.activitypub.getOutbox);
|
||||||
|
app.post('/user/:userslug/outbox', middlewares, controllers.activitypub.postOutbox);
|
||||||
|
|
||||||
|
app.get('/user/:userslug/inbox', middlewares, controllers.activitypub.getInbox);
|
||||||
|
app.post('/user/:userslug/inbox', middlewares, controllers.activitypub.postInbox);
|
||||||
};
|
};
|
||||||
|
|||||||
Reference in New Issue
Block a user