فهرست منبع

Merge pull request #5106 from ipyramiddev/master

Added a condition to filter unwanted webhooks
Lauri Ojansivu 1 سال پیش
والد
کامیت
ed03a9ccaf
1فایلهای تغییر یافته به همراه7 افزوده شده و 2 حذف شده
  1. 7 2
      server/notifications/outgoing.js

+ 7 - 2
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;