Merge pull request #5106 from ipyramiddev/master

Added a condition to filter unwanted webhooks
This commit is contained in:
Lauri Ojansivu 2023-08-25 20:10:52 +03:00 committed by GitHub
commit ed03a9ccaf
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -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;