forked from rDrama/rDrama
1
0
Fork 0
master
Aevann1 2022-02-21 04:29:06 +02:00
parent 12adcd390a
commit 915d36d319
1 changed files with 20 additions and 22 deletions

View File

@ -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()