diff options
author | Sam X. Chen <sam.xi.chen@gmail.com> | 2019-08-29 22:07:40 -0400 |
---|---|---|
committer | Sam X. Chen <sam.xi.chen@gmail.com> | 2019-08-29 22:07:40 -0400 |
commit | dd0682328bc26bbe852fb19a85131e4017c547b0 (patch) | |
tree | e9171a1703b96820aefb38e7bfb3f03defbee12f /models/activities.js | |
parent | 3f0600fed70512f87dc20fe039695d1681a73d39 (diff) | |
download | wekan-dd0682328bc26bbe852fb19a85131e4017c547b0.tar.gz wekan-dd0682328bc26bbe852fb19a85131e4017c547b0.tar.bz2 wekan-dd0682328bc26bbe852fb19a85131e4017c547b0.zip |
Add Feature: enable two-way webhooks - stage two
Diffstat (limited to 'models/activities.js')
-rw-r--r-- | models/activities.js | 23 |
1 files changed, 17 insertions, 6 deletions
diff --git a/models/activities.js b/models/activities.js index 3ecd5c8c..f64fce10 100644 --- a/models/activities.js +++ b/models/activities.js @@ -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; + }, + ); + }); } }); } |