make "media silenced" work like "silenced"

that is, silencing `foo.com` also silences `sub.foo.com`
This commit is contained in:
dakkar 2024-08-06 11:14:24 +01:00
parent 02748edd17
commit 151470d882

View file

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