dg
This commit is contained in:
parent
38a6ab7906
commit
ea2445baf3
2 changed files with 6 additions and 4 deletions
|
@ -626,7 +626,8 @@ def api_comment(v):
|
||||||
g.db.add(n)
|
g.db.add(n)
|
||||||
|
|
||||||
if parent.author.id != v.id and PUSHER_ID != 'blahblahblah':
|
if parent.author.id != v.id and PUSHER_ID != 'blahblahblah':
|
||||||
gevent.spawn(pusher_thread, f'{request.host}{parent.author.id}', c)
|
try: gevent.spawn(pusher_thread, f'{request.host}{parent.author.id}', c)
|
||||||
|
except: pass
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -633,13 +633,14 @@ def message2(v, username):
|
||||||
notif = Notification(comment_id=c.id, user_id=user.id)
|
notif = Notification(comment_id=c.id, user_id=user.id)
|
||||||
g.db.add(notif)
|
g.db.add(notif)
|
||||||
|
|
||||||
|
g.db.commit()
|
||||||
|
|
||||||
if PUSHER_ID != 'blahblahblah':
|
if PUSHER_ID != 'blahblahblah':
|
||||||
if len(message) > 500: notifbody = message[:500] + '...'
|
if len(message) > 500: notifbody = message[:500] + '...'
|
||||||
else: notifbody = message
|
else: notifbody = message
|
||||||
|
|
||||||
gevent.spawn(pusher_thread2, f'{request.host}{user.id}', notifbody, v.username)
|
try: gevent.spawn(pusher_thread2, f'{request.host}{user.id}', notifbody, v.username)
|
||||||
|
except: pass
|
||||||
g.db.commit()
|
|
||||||
|
|
||||||
return {"message": "Message sent!"}
|
return {"message": "Message sent!"}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue