mirror of
https://github.com/R0m1k3/Priceflow.git
synced 2026-10-23 15:18:12 +02:00
Merge pull request #56 from R0m1k3/antigravity
feat: Add notification service with Apprise integration for email, Di…
This commit is contained in:
1 file changed
+7
-4
@@ -64,8 +64,8 @@ class NotificationService:
|
|||||||
if not webhook_url:
|
if not webhook_url:
|
||||||
return None
|
return None
|
||||||
|
|
||||||
# If it's already a mattermost:// URL, return it
|
# If it's already a mmost:// or mmosts:// URL, return it
|
||||||
if webhook_url.startswith("mattermost://"):
|
if webhook_url.startswith("mmost://") or webhook_url.startswith("mmosts://"):
|
||||||
return webhook_url
|
return webhook_url
|
||||||
|
|
||||||
# Parse standard webhook URL: https://mattermost.example.com/hooks/TOKEN
|
# Parse standard webhook URL: https://mattermost.example.com/hooks/TOKEN
|
||||||
@@ -76,8 +76,11 @@ class NotificationService:
|
|||||||
token = path_parts[-1]
|
token = path_parts[-1]
|
||||||
host = parsed.netloc
|
host = parsed.netloc
|
||||||
|
|
||||||
# Apprise format: mattermost://host/token
|
# Determine scheme based on original URL
|
||||||
return f"mattermost://{host}/{token}"
|
scheme = "mmosts" if parsed.scheme == "https" else "mmost"
|
||||||
|
|
||||||
|
# Apprise format: mmosts://host/token (without /hooks/)
|
||||||
|
return f"{scheme}://{host}/{token}"
|
||||||
except Exception:
|
except Exception:
|
||||||
return webhook_url
|
return webhook_url
|
||||||
|
|
||||||
|
|||||||
Reference in new issue
Block a user