remotes/1693045480750635534/spooky-22
Aevann1 2022-04-03 17:53:20 +02:00
parent 4c44c2ce92
commit 6647457a4b
2 changed files with 6 additions and 4 deletions

View File

@ -626,7 +626,8 @@ def api_comment(v):
g.db.add(n)
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

View File

@ -633,13 +633,14 @@ def message2(v, username):
notif = Notification(comment_id=c.id, user_id=user.id)
g.db.add(notif)
g.db.commit()
if PUSHER_ID != 'blahblahblah':
if len(message) > 500: notifbody = message[:500] + '...'
else: notifbody = message
gevent.spawn(pusher_thread2, f'{request.host}{user.id}', notifbody, v.username)
g.db.commit()
try: gevent.spawn(pusher_thread2, f'{request.host}{user.id}', notifbody, v.username)
except: pass
return {"message": "Message sent!"}