summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorsyuilo <syuilotan@yahoo.co.jp>2018-04-23 15:37:27 +0900
committersyuilo <syuilotan@yahoo.co.jp>2018-04-23 15:37:27 +0900
commit1131ce8a716b2cd2b4ed1253af40b26ae0631297 (patch)
tree4cd03de39bf962aa073edbd9e453001cfc6c25fb /src
parent他のMisskeyインスタンスにリアクション情報を伝えるように (diff)
downloadsharkey-1131ce8a716b2cd2b4ed1253af40b26ae0631297.tar.gz
sharkey-1131ce8a716b2cd2b4ed1253af40b26ae0631297.tar.bz2
sharkey-1131ce8a716b2cd2b4ed1253af40b26ae0631297.zip
sharedInboxを提供
Diffstat (limited to 'src')
-rw-r--r--src/remote/activitypub/renderer/person.ts1
-rw-r--r--src/server/activitypub.ts10
2 files changed, 8 insertions, 3 deletions
diff --git a/src/remote/activitypub/renderer/person.ts b/src/remote/activitypub/renderer/person.ts
index f1c8056a75..424305f8d3 100644
--- a/src/remote/activitypub/renderer/person.ts
+++ b/src/remote/activitypub/renderer/person.ts
@@ -10,6 +10,7 @@ export default user => {
id,
inbox: `${id}/inbox`,
outbox: `${id}/outbox`,
+ sharedInbox: `${config.url}/inbox`,
url: `${config.url}/@${user.username}`,
preferredUsername: user.username,
name: user.name,
diff --git a/src/server/activitypub.ts b/src/server/activitypub.ts
index 73ed43406d..3c07a3e2f2 100644
--- a/src/server/activitypub.ts
+++ b/src/server/activitypub.ts
@@ -1,4 +1,5 @@
import * as mongo from 'mongodb';
+import * as Koa from 'koa';
import * as Router from 'koa-router';
const json = require('koa-json-body');
const httpSignature = require('http-signature');
@@ -19,8 +20,7 @@ const router = new Router();
//#region Routing
-// inbox
-router.post('/users/:user/inbox', json(), ctx => {
+function inbox(ctx: Koa.Context) {
let signature;
ctx.req.headers.authorization = 'Signature ' + ctx.req.headers.signature;
@@ -39,7 +39,11 @@ router.post('/users/:user/inbox', json(), ctx => {
}).save();
ctx.status = 202;
-});
+}
+
+// inbox
+router.post('/inbox', json(), inbox);
+router.post('/users/:user/inbox', json(), inbox);
// note
router.get('/notes/:note', async (ctx, next) => {