mirror of
https://github.com/sim1222/misskey.git
synced 2025-08-07 01:04:03 +09:00
improve webhook
This commit is contained in:
@ -65,8 +65,7 @@ async function cancelRequest(follower: User, followee: User) {
|
||||
|
||||
const webhooks = (await getActiveWebhooks()).filter(x => x.userId === follower.id && x.on.includes('unfollow'));
|
||||
for (const webhook of webhooks) {
|
||||
webhookDeliver(webhook, {
|
||||
type: 'unfollow',
|
||||
webhookDeliver(webhook, 'unfollow', {
|
||||
user: packed,
|
||||
});
|
||||
}
|
||||
@ -118,8 +117,7 @@ async function unFollow(follower: User, followee: User) {
|
||||
|
||||
const webhooks = (await getActiveWebhooks()).filter(x => x.userId === follower.id && x.on.includes('unfollow'));
|
||||
for (const webhook of webhooks) {
|
||||
webhookDeliver(webhook, {
|
||||
type: 'unfollow',
|
||||
webhookDeliver(webhook, 'unfollow', {
|
||||
user: packed,
|
||||
});
|
||||
}
|
||||
|
@ -97,8 +97,7 @@ export async function insertFollowingDoc(followee: { id: User['id']; host: User[
|
||||
|
||||
const webhooks = (await getActiveWebhooks()).filter(x => x.userId === follower.id && x.on.includes('follow'));
|
||||
for (const webhook of webhooks) {
|
||||
webhookDeliver(webhook, {
|
||||
type: 'follow',
|
||||
webhookDeliver(webhook, 'follow', {
|
||||
user: packed,
|
||||
});
|
||||
}
|
||||
@ -112,8 +111,7 @@ export async function insertFollowingDoc(followee: { id: User['id']; host: User[
|
||||
|
||||
const webhooks = (await getActiveWebhooks()).filter(x => x.userId === followee.id && x.on.includes('followed'));
|
||||
for (const webhook of webhooks) {
|
||||
webhookDeliver(webhook, {
|
||||
type: 'followed',
|
||||
webhookDeliver(webhook, 'followed', {
|
||||
user: packed,
|
||||
});
|
||||
}
|
||||
|
@ -38,8 +38,7 @@ export default async function(follower: { id: User['id']; host: User['host']; ur
|
||||
|
||||
const webhooks = (await getActiveWebhooks()).filter(x => x.userId === follower.id && x.on.includes('unfollow'));
|
||||
for (const webhook of webhooks) {
|
||||
webhookDeliver(webhook, {
|
||||
type: 'unfollow',
|
||||
webhookDeliver(webhook, 'unfollow', {
|
||||
user: packed,
|
||||
});
|
||||
}
|
||||
|
@ -115,8 +115,7 @@ async function publishUnfollow(followee: Both, follower: Local) {
|
||||
|
||||
const webhooks = (await getActiveWebhooks()).filter(x => x.userId === follower.id && x.on.includes('unfollow'));
|
||||
for (const webhook of webhooks) {
|
||||
webhookDeliver(webhook, {
|
||||
type: 'unfollow',
|
||||
webhookDeliver(webhook, 'unfollow', {
|
||||
user: packedFollowee,
|
||||
});
|
||||
}
|
||||
|
@ -350,8 +350,7 @@ export default async (user: { id: User['id']; username: User['username']; host:
|
||||
getActiveWebhooks().then(webhooks => {
|
||||
webhooks = webhooks.filter(x => x.userId === user.id && x.on.includes('note'));
|
||||
for (const webhook of webhooks) {
|
||||
webhookDeliver(webhook, {
|
||||
type: 'note',
|
||||
webhookDeliver(webhook, 'note', {
|
||||
note: noteObj,
|
||||
});
|
||||
}
|
||||
@ -380,8 +379,7 @@ export default async (user: { id: User['id']; username: User['username']; host:
|
||||
|
||||
const webhooks = (await getActiveWebhooks()).filter(x => x.userId === data.reply!.userId && x.on.includes('reply'));
|
||||
for (const webhook of webhooks) {
|
||||
webhookDeliver(webhook, {
|
||||
type: 'reply',
|
||||
webhookDeliver(webhook, 'reply', {
|
||||
note: noteObj,
|
||||
});
|
||||
}
|
||||
@ -407,8 +405,7 @@ export default async (user: { id: User['id']; username: User['username']; host:
|
||||
|
||||
const webhooks = (await getActiveWebhooks()).filter(x => x.userId === data.renote!.userId && x.on.includes('renote'));
|
||||
for (const webhook of webhooks) {
|
||||
webhookDeliver(webhook, {
|
||||
type: 'renote',
|
||||
webhookDeliver(webhook, 'renote', {
|
||||
note: noteObj,
|
||||
});
|
||||
}
|
||||
@ -650,8 +647,7 @@ async function createMentionedEvents(mentionedUsers: MinimumUser[], note: Note,
|
||||
|
||||
const webhooks = (await getActiveWebhooks()).filter(x => x.userId === u.id && x.on.includes('mention'));
|
||||
for (const webhook of webhooks) {
|
||||
webhookDeliver(webhook, {
|
||||
type: 'mention',
|
||||
webhookDeliver(webhook, 'mention', {
|
||||
note: detailPackedNote,
|
||||
});
|
||||
}
|
||||
|
Reference in New Issue
Block a user