add push notifs for repeatable notifications

pull/134/head
Aevann 2023-02-24 04:09:49 +02:00
parent 6f981a58b8
commit 760b2e6a4d
2 changed files with 12 additions and 0 deletions

View File

@ -37,12 +37,18 @@ def send_repeatable_notification(uid, text):
if not existing_notif:
notif = Notification(comment_id=c.id, user_id=uid)
g.db.add(notif)
g.db.flush()
push_notif({uid}, 'New notification', text, f'{SITE_FULL}/comment/{c.id}?read=true#context')
return
cid = create_comment(text_html)
notif = Notification(comment_id=cid, user_id=uid)
g.db.add(notif)
g.db.flush()
push_notif({uid}, 'New notification', text, f'{SITE_FULL}/comment/{cid}?read=true#context')
def send_notification(uid, text):

View File

@ -176,12 +176,18 @@ def send_repeatable_notification_duplicated(uid, text):
if not existing_notif:
notif = Notification(comment_id=c.id, user_id=uid)
g.db.add(notif)
g.db.flush()
push_notif({uid}, 'New notification', text, f'{SITE_FULL}/comment/{c.id}?read=true#context')
return
cid = create_comment_duplicated(text_html)
notif = Notification(comment_id=cid, user_id=uid)
g.db.add(notif)
g.db.flush()
push_notif({uid}, 'New notification', text, f'{SITE_FULL}/comment/{cid}?read=true#context')
def execute_blackjack(v, target, body, type):
if not blackjack or not body: return False