feat: restore ntfy interactive settings test delivery support

Squash merge PR #591: feat: restore ntfy interactive settings test delivery support
This commit is contained in:
Daniel Volz
2026-05-10 23:04:24 +02:00
committed by GitHub
parent d99bc3d99e
commit 255746d9f5
4 changed files with 421 additions and 3 deletions
+3 -2
View File
@@ -2,6 +2,7 @@ import { eq } from "drizzle-orm";
import { db } from "../db/client.js";
import { userSettings } from "../db/schema.js";
import type { Language } from "../i18n/translations.js";
import { isNtfyNotificationUrl } from "./notifications/action-renderer.js";
export type UserSettings = {
userId: number;
@@ -81,7 +82,7 @@ export function getNotificationProvider(url: string): string {
if (url.startsWith("telegram://")) return "telegram";
if (url.startsWith("gotify://")) return "gotify";
if (url.startsWith("pushover://")) return "pushover";
if (url.startsWith("ntfy://")) return "ntfy";
if (isNtfyNotificationUrl(url)) return "ntfy";
try {
const parsed = new URL(url);
@@ -231,7 +232,7 @@ export function sanitizeNotificationUrl(
return { url: discordWebhookUrl, isNtfy: false };
}
const isNtfy = urlStr.startsWith("ntfy://");
const isNtfy = isNtfyNotificationUrl(urlStr);
const normalizedUrl = isNtfy ? urlStr.replace("ntfy://", "https://") : urlStr;
const parsed = new URL(normalizedUrl);