bb
This commit is contained in:
parent
104b561828
commit
17588ce882
1 changed files with 26 additions and 26 deletions
|
@ -497,35 +497,35 @@ def messagereply(v):
|
||||||
g.db.add(new_comment)
|
g.db.add(new_comment)
|
||||||
g.db.flush()
|
g.db.flush()
|
||||||
|
|
||||||
notif = Notification(comment_id=new_comment.id, user_id=user_id)
|
if user_id != v.id:
|
||||||
g.db.add(notif)
|
notif = Notification(comment_id=new_comment.id, user_id=user_id)
|
||||||
|
g.db.add(notif)
|
||||||
|
|
||||||
|
if len(message) > 100: notifbody = message[:100] + '...'
|
||||||
if len(message) > 100: notifbody = message[:100] + '...'
|
else: notifbody = message
|
||||||
else: notifbody = message
|
|
||||||
|
beams_client.publish_to_interests(
|
||||||
beams_client.publish_to_interests(
|
interests=[f'{request.host}{user_id}'],
|
||||||
interests=[f'{request.host}{user_id}'],
|
publish_body={
|
||||||
publish_body={
|
'web': {
|
||||||
'web': {
|
'notification': {
|
||||||
'notification': {
|
'title': f'New message from @{v.username}',
|
||||||
'title': f'New message from @{v.username}',
|
'body': notifbody,
|
||||||
'body': notifbody,
|
'deep_link': f'https://{site}/notifications?messages=true',
|
||||||
'deep_link': f'https://{site}/notifications?messages=true',
|
'icon': f'https://{request.host}/assets/images/{SITE_NAME}/icon.webp',
|
||||||
'icon': f'https://{request.host}/assets/images/{SITE_NAME}/icon.webp',
|
}
|
||||||
|
},
|
||||||
|
'fcm': {
|
||||||
|
'notification': {
|
||||||
|
'title': f'New message from @{v.username}',
|
||||||
|
'body': notifbody,
|
||||||
|
},
|
||||||
|
'data': {
|
||||||
|
'url': 'notifications?messages=true',
|
||||||
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
'fcm': {
|
)
|
||||||
'notification': {
|
|
||||||
'title': f'New message from @{v.username}',
|
|
||||||
'body': notifbody,
|
|
||||||
},
|
|
||||||
'data': {
|
|
||||||
'url': 'notifications?messages=true',
|
|
||||||
}
|
|
||||||
}
|
|
||||||
},
|
|
||||||
)
|
|
||||||
|
|
||||||
|
|
||||||
if new_comment.top_comment.sentto == 0:
|
if new_comment.top_comment.sentto == 0:
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue