bbb
This commit is contained in:
parent
d304fae0ac
commit
542959cb6d
2 changed files with 41 additions and 47 deletions
|
@ -466,7 +466,6 @@ def api_comment(v):
|
||||||
g.db.add(n)
|
g.db.add(n)
|
||||||
|
|
||||||
if parent.author.id != v.id:
|
if parent.author.id != v.id:
|
||||||
try:
|
|
||||||
beams_client.publish_to_interests(
|
beams_client.publish_to_interests(
|
||||||
interests=[f'{request.host}{parent.author.id}'],
|
interests=[f'{request.host}{parent.author.id}'],
|
||||||
publish_body={
|
publish_body={
|
||||||
|
@ -484,13 +483,11 @@ def api_comment(v):
|
||||||
'body': c.body,
|
'body': c.body,
|
||||||
},
|
},
|
||||||
'data': {
|
'data': {
|
||||||
'url': f'https://{site}/comment/{c.id}?context=9&read=true#context',
|
'url': f'comment/{c.id}?context=9&read=true#context',
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
)
|
)
|
||||||
except Exception as e:
|
|
||||||
print(e)
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -435,7 +435,6 @@ def message2(v, username):
|
||||||
g.db.add(notif)
|
g.db.add(notif)
|
||||||
|
|
||||||
|
|
||||||
try:
|
|
||||||
beams_client.publish_to_interests(
|
beams_client.publish_to_interests(
|
||||||
interests=[f'{request.host}{parent.author.id}'],
|
interests=[f'{request.host}{parent.author.id}'],
|
||||||
publish_body={
|
publish_body={
|
||||||
|
@ -449,17 +448,15 @@ def message2(v, username):
|
||||||
},
|
},
|
||||||
'fcm': {
|
'fcm': {
|
||||||
'notification': {
|
'notification': {
|
||||||
'title': f'New reply by @{v.username}',
|
'title': f'New message from @{v.username}',
|
||||||
'body': c.body,
|
'body': message,
|
||||||
},
|
},
|
||||||
'data': {
|
'data': {
|
||||||
'url': f'https://{site}/notifications',
|
'url': f'notifications',
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
)
|
)
|
||||||
except Exception as e:
|
|
||||||
print(e)
|
|
||||||
|
|
||||||
g.db.commit()
|
g.db.commit()
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue