feat: respect user traffic_warning notification preference in webhook handler

This commit is contained in:
c0mrade
2026-04-10 15:37:33 +03:00
parent 63fdfe4a42
commit 7208a52c94
@@ -1304,6 +1304,13 @@ class RemnaWaveWebhookService:
async def _handle_bandwidth_threshold(
self, db: AsyncSession, user: User, subscription: Subscription | None, data: dict
) -> None:
# Respect user notification preferences
from app.utils.notification_prefs import is_traffic_warning_enabled
if not is_traffic_warning_enabled(user):
logger.debug('Traffic warning disabled by user prefs', user_id=user.id)
return
# Extract threshold percentage from meta or data
percent = data.get('thresholdPercent') or data.get('threshold', '')
if not percent: