From d18c3ae86a0a87b213d18418313e1c66a77b1832 Mon Sep 17 00:00:00 2001 From: Aevann Date: Sun, 12 Mar 2023 16:56:44 +0200 Subject: [PATCH] censor push notifs to prevent irl embarrassment --- files/helpers/alerts.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/files/helpers/alerts.py b/files/helpers/alerts.py index bfeff89fc..559a731c5 100644 --- a/files/helpers/alerts.py +++ b/files/helpers/alerts.py @@ -201,6 +201,8 @@ def push_notif(uids, title, body, url_or_comment): if len(body) > PUSH_NOTIF_LIMIT: body = body[:PUSH_NOTIF_LIMIT] + "..." + body = censor_slurs(body, None) + subscriptions = g.db.query(PushSubscription.subscription_json).filter(PushSubscription.user_id.in_(uids)).all() subscriptions = [x[0] for x in subscriptions] g.db.flush()