From 151470d882eaac1f9bc2b334abb432c1fa427e35 Mon Sep 17 00:00:00 2001 From: dakkar Date: Tue, 6 Aug 2024 11:14:24 +0100 Subject: [PATCH] make "media silenced" work like "silenced" that is, silencing `foo.com` also silences `sub.foo.com` --- packages/backend/src/core/UtilityService.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/backend/src/core/UtilityService.ts b/packages/backend/src/core/UtilityService.ts index 0d6af8b33a..22871e44f8 100644 --- a/packages/backend/src/core/UtilityService.ts +++ b/packages/backend/src/core/UtilityService.ts @@ -45,7 +45,7 @@ export class UtilityService { @bindThis public isMediaSilencedHost(silencedHosts: string[] | undefined, host: string | null): boolean { if (!silencedHosts || host == null) return false; - return silencedHosts.some(x => host.toLowerCase() === x); + return silencedHosts.some(x => `.${host.toLowerCase()}`.endsWith(`.${x}`)); } @bindThis