From bea4c446d61161fbec6c530be4ee2d481b1838a0 Mon Sep 17 00:00:00 2001 From: Aevann1 Date: Mon, 21 Feb 2022 04:29:06 +0200 Subject: [PATCH] dfs --- files/routes/users.py | 42 ++++++++++++++++++++---------------------- 1 file changed, 20 insertions(+), 22 deletions(-) diff --git a/files/routes/users.py b/files/routes/users.py index 9e0ddf35f..903a358af 100644 --- a/files/routes/users.py +++ b/files/routes/users.py @@ -494,30 +494,28 @@ def message2(v, username): if len(message) > 500: notifbody = message[:500] + '...' else: notifbody = message - try: - beams_client.publish_to_interests( - interests=[f'{request.host}{user.id}'], - publish_body={ - 'web': { - 'notification': { - 'title': f'New message from @{v.username}', - 'body': notifbody, - 'deep_link': f'{SITE_FULL}/notifications?messages=true', - 'icon': f'{SITE_FULL}/assets/images/{SITE_NAME}/icon.webp?a=1011', - } - }, - 'fcm': { - 'notification': { - 'title': f'New message from @{v.username}', - 'body': notifbody, - }, - 'data': { - 'url': '/notifications?messages=true', - } + beams_client.publish_to_interests( + interests=[f'{request.host}{user.id}'], + publish_body={ + 'web': { + 'notification': { + 'title': f'New message from @{v.username}', + 'body': notifbody, + 'deep_link': f'{SITE_FULL}/notifications?messages=true', + 'icon': f'{SITE_FULL}/assets/images/{SITE_NAME}/icon.webp?a=1011', } }, - ) - except: pass + 'fcm': { + 'notification': { + 'title': f'New message from @{v.username}', + 'body': notifbody, + }, + 'data': { + 'url': '/notifications?messages=true', + } + } + }, + ) g.db.commit()