notify: honor fixed ntfy topic

This commit is contained in:
chelsea
2025-11-11 23:43:43 -06:00
parent b89e1b196b
commit 2cbd56cb6b
3 changed files with 8 additions and 2 deletions

View File

@@ -9,6 +9,7 @@ from Memory import MemoryManager
ntfyBaseUrl = os.getenv("NTFY_BASE_URL")
ntfyFixedTopic = os.getenv("NTFY_TOPIC")
ntfyTopicTemplate = os.getenv("NTFY_TOPIC_TEMPLATE", "adhdbot-{userId}")
ntfyAuthToken = os.getenv("NTFY_AUTH_TOKEN")
@@ -76,6 +77,9 @@ class NotificationDispatcher:
@staticmethod
def buildTopic(actualUser: str) -> str:
fixed = (ntfyFixedTopic or "").strip()
if fixed:
return fixed
template = ntfyTopicTemplate or ""
if not template:
return ""