mirror of
https://github.com/wekan/wekan.git
synced 2025-09-22 01:50:48 +02:00
Add Feature: enable two-way webhooks - stage two
This commit is contained in:
parent
3f0600fed7
commit
dd0682328b
4 changed files with 103 additions and 26 deletions
|
@ -184,10 +184,11 @@ if (Meteor.isServer) {
|
|||
// it's person at himself, ignore it?
|
||||
continue;
|
||||
}
|
||||
const user = Users.findOne(username) || Users.findOne({ username });
|
||||
const uid = user && user._id;
|
||||
const atUser =
|
||||
Users.findOne(username) || Users.findOne({ username });
|
||||
const uid = atUser && atUser._id;
|
||||
params.atUsername = username;
|
||||
params.atEmails = user.emails;
|
||||
params.atEmails = atUser.emails;
|
||||
if (board.hasMember(uid)) {
|
||||
title = 'act-atUserComment';
|
||||
watchers = _.union(watchers, [uid]);
|
||||
|
@ -268,13 +269,23 @@ if (Meteor.isServer) {
|
|||
});
|
||||
|
||||
const integrations = Integrations.find({
|
||||
boardId: board._id,
|
||||
type: 'outgoing-webhooks',
|
||||
boardId: { $in: [board._id, Integrations.Const.GLOBAL_WEBHOOK_ID] },
|
||||
// type: 'outgoing-webhooks', // all types
|
||||
enabled: true,
|
||||
activities: { $in: [description, 'all'] },
|
||||
}).fetch();
|
||||
if (integrations.length > 0) {
|
||||
Meteor.call('outgoingWebhooks', integrations, description, params);
|
||||
integrations.forEach(integration => {
|
||||
Meteor.call(
|
||||
'outgoingWebhooks',
|
||||
integration,
|
||||
description,
|
||||
params,
|
||||
() => {
|
||||
return;
|
||||
},
|
||||
);
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue