summaryrefslogtreecommitdiff
path: root/packages/backend/src/queue/processors/webhook-deliver.ts
diff options
context:
space:
mode:
authorsyuilo <Syuilotan@yahoo.co.jp>2022-04-03 22:36:30 +0900
committersyuilo <Syuilotan@yahoo.co.jp>2022-04-03 22:36:30 +0900
commitf8e6f3cc73b041acd7c8e8186090a297db3100a9 (patch)
treecd72442610caedb742419069065d014edbefadd8 /packages/backend/src/queue/processors/webhook-deliver.ts
parentfix type (diff)
downloadsharkey-f8e6f3cc73b041acd7c8e8186090a297db3100a9.tar.gz
sharkey-f8e6f3cc73b041acd7c8e8186090a297db3100a9.tar.bz2
sharkey-f8e6f3cc73b041acd7c8e8186090a297db3100a9.zip
improve webhook
Diffstat (limited to 'packages/backend/src/queue/processors/webhook-deliver.ts')
-rw-r--r--packages/backend/src/queue/processors/webhook-deliver.ts14
1 files changed, 8 insertions, 6 deletions
diff --git a/packages/backend/src/queue/processors/webhook-deliver.ts b/packages/backend/src/queue/processors/webhook-deliver.ts
index a4d39d86e4..01d779311e 100644
--- a/packages/backend/src/queue/processors/webhook-deliver.ts
+++ b/packages/backend/src/queue/processors/webhook-deliver.ts
@@ -8,13 +8,9 @@ import config from '@/config/index.js';
const logger = new Logger('webhook');
-let latest: string | null = null;
-
export default async (job: Bull.Job<WebhookDeliverJobData>) => {
try {
- if (latest !== (latest = JSON.stringify(job.data.content, null, 2))) {
- logger.debug(`delivering ${latest}`);
- }
+ logger.debug(`delivering ${job.data.webhookId}`);
const res = await getResponse({
url: job.data.to,
@@ -25,7 +21,13 @@ export default async (job: Bull.Job<WebhookDeliverJobData>) => {
'X-Misskey-Hook-Id': job.data.webhookId,
'X-Misskey-Hook-Secret': job.data.secret,
},
- body: JSON.stringify(job.data.content),
+ body: JSON.stringify({
+ hookId: job.data.webhookId,
+ eventId: job.data.eventId,
+ createdAt: job.data.createdAt,
+ type: job.data.type,
+ body: job.data.content,
+ }),
});
Webhooks.update({ id: job.data.webhookId }, {