From b9f74c5add8a29ee6411b83598c4703199101f39 Mon Sep 17 00:00:00 2001 From: Yevhenii Pertiaka Date: Sat, 26 Aug 2023 01:07:02 +0900 Subject: [PATCH] added a condition to filter unwanted webhooks --- server/notifications/outgoing.js | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/server/notifications/outgoing.js b/server/notifications/outgoing.js index 5c9c3bfdf..fd42df174 100644 --- a/server/notifications/outgoing.js +++ b/server/notifications/outgoing.js @@ -135,11 +135,16 @@ if (Meteor.isServer) { const userId = params.userId ? params.userId : integrations[0].userId; const user = ReactiveCache.getUser(userId); - const text = `${params.user} ${TAPi18n.__( + const descriptionText = TAPi18n.__( description, quoteParams, user.getLanguage(), - )}\n${params.url}`; + ); + + // If you don't want a hook, set the webhook description to "-". + if (descriptionText === "-") return; + + const text = `${params.user} ${descriptionText}\n${params.url}`; if (text.length === 0) return;